Skip to content

Commit 6b8e792

Browse files
committed
viztex
1 parent ff34d7e commit 6b8e792

File tree

4 files changed

+37
-75
lines changed

4 files changed

+37
-75
lines changed

src/core/cgl/cgl_state.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ export class CglContext extends CgContext
406406

407407
/**
408408
* @deprecated
409-
* @param {CgShader|Shader} s
409+
* @param {Shader} s
410410
*/
411411
setShader(s)
412412
{
@@ -418,7 +418,7 @@ export class CglContext extends CgContext
418418
* @function pushShader
419419
* @memberof Context
420420
* @instance
421-
* @param {CglShader} shader
421+
* @param {Shader} shader
422422
* @function
423423
*/
424424
pushShader(shader)

src/ops/base/Ops.Anim.Bang/Ops.Anim.Bang.json

+9-1
Original file line numberDiff line numberDiff line change
@@ -58,5 +58,13 @@
5858
]
5959
},
6060
"exampleProjectId": "TctR5r",
61-
"license": "MIT"
61+
"license": "MIT",
62+
"changelog": [
63+
{
64+
"message": "",
65+
"type": "feature",
66+
"author": "pandur",
67+
"date": 1741277743673
68+
}
69+
]
6270
}

src/ops/base/Ops.Ui.VizTexture/Ops.Ui.VizTexture.js

+19-51
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ updateUi();
2727
if (CABLES.UI)
2828
{
2929
timer.play();
30-
// op.checkMainloopExists();
3130
}
3231

3332
function updateUi()
@@ -62,11 +61,6 @@ function updateDefines()
6261

6362
op.renderVizLayerGl = (ctx, layer) =>
6463
{
65-
// if (firstTime)
66-
// {
67-
// firstTime = false;
68-
// op.checkMainloopExists();
69-
// }
7064
if (!inTex.isLinked()) return;
7165
if (!layer.useGl) return;
7266

@@ -314,63 +308,37 @@ op.renderVizLayerGl = (ctx, layer) =>
314308
}
315309

316310
let info = "";
317-
if (port.get() && port.get().getInfoOneLine) info += port.get().getInfoOneLine() + "\n";
311+
if (inShowInfo.get() && port.get() && port.get().getInfoOneLine) info += port.get().getInfoOneLine() + "\n";
318312
outInfo.set(info);
319313

320314
if (inPickColor.get())
321315
{
322316
info += colorString + "\n";
323317

324-
// ctx.save();
325-
// ctx.scale(layer.scale, layer.scale);
326-
// ctx.font = "normal 10px sourceCodePro";
327-
// ctx.fillStyle = "#000";
328-
// ctx.fillText("RGBA " + colorString, layer.x / layer.scale + 10 + 0.5, layer.y / layer.scale + 10 + 0.5);
329-
// ctx.fillStyle = "#aaa";
330-
// ctx.fillText("RGBA " + colorString, layer.x / layer.scale + 10, layer.y / layer.scale + 10);
331-
332-
// ctx.restore();
333-
334318
const x = imgPosX + imgSizeW * inX.get();
335319
const y = imgPosY + imgSizeH * inY.get();
336320

337-
ctx.fillStyle = "#000";
338-
ctx.fillRect(
339-
x - 1,
340-
y - 10,
341-
3,
342-
20);
343-
344-
ctx.fillRect(
345-
x,
346-
y - 1,
347-
20,
348-
3);
349-
350-
ctx.fillStyle = "#fff";
351-
ctx.fillRect(
352-
x - 1,
353-
y - 10,
354-
1,
355-
20);
356-
357-
ctx.fillRect(
358-
x - 10,
359-
y - 1,
360-
20,
361-
1);
321+
for (let ii = 0; ii < 2; ii++)
322+
{
323+
if (ii == 0)ctx.fillStyle = "#000";
324+
else ctx.fillStyle = "#fff";
325+
326+
ctx.fillRect(
327+
x - 1 + ii,
328+
y - 10 + ii,
329+
1,
330+
20);
331+
332+
ctx.fillRect(
333+
x - 10 + ii,
334+
y - 1 + ii,
335+
20,
336+
1);
337+
}
362338
}
363339

364-
if (inShowInfo.get())
340+
if (inShowInfo.get() || inPickColor.get())
365341
{
366-
// ctx.save();
367-
// ctx.scale(layer.scale, layer.scale);
368-
// ctx.font = "normal 10px sourceCodePro";
369-
// ctx.fillStyle = "#000";
370-
// ctx.fillText(info, layer.x / layer.scale + 5 + 0.5, (layer.y + layer.height) / layer.scale - 5 + 0.5);
371-
// ctx.fillStyle = "#aaa";
372-
// ctx.fillText(info, layer.x / layer.scale + 5, (layer.y + layer.height) / layer.scale - 5);
373-
// ctx.restore();
374342
op.setUiAttrib({ "comment": info });
375343
}
376344

src/ops/base/Ops.Ui.VizTexture/Ops.Ui.VizTexture.json

+7-21
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,8 @@
44
{
55
"message": "created op",
66
"author": "pandur",
7-
"date": 1591630315193
8-
},
9-
{
10-
"message": "Ops.User.pandur.PreviewTexture renamed to Ops.Admin.PreviewTexture",
11-
"author": "pandur",
12-
"date": 1591801952881
13-
},
14-
{
15-
"message": "Ops.Admin.PreviewTexture renamed to Ops.Dev.VizTexture",
16-
"author": "pandur",
17-
"date": 1621835702412
18-
},
19-
{
20-
"message": "Ops.Dev.VizTexture renamed to Ops.Ui.VizTexture",
21-
"author": "pandur",
22-
"date": 1637834150633
7+
"date": 1591630315193,
8+
"type": "new"
239
},
2410
{
2511
"message": "now also uses cubemaps alpha channel",
@@ -28,16 +14,16 @@
2814
"date": 1671034575804
2915
},
3016
{
31-
"message": " added core lib: cgl_pixelreader",
32-
"type": "",
17+
"message": "Show pixel grid when zoomed in ",
18+
"type": "improvement",
3319
"author": "pandur",
34-
"date": 1686651916948
20+
"date": 1709801021905
3521
},
3622
{
37-
"message": "Show pixel grid when zoomed in ",
23+
"message": "Also show pixelcolor when show info is not active / fix crosshair",
3824
"type": "improvement",
3925
"author": "pandur",
40-
"date": 1709801021905
26+
"date": 1741340486744
4127
}
4228
],
4329
"authorName": "pandur",

0 commit comments

Comments
 (0)