Minor fix
This commit is contained in:
+21
-14
@@ -154,6 +154,9 @@ app.registerExtension({
|
||||
|
||||
if ((this.flags && this.flags.collapsed) || (!this.rs_img1 && !this.rs_img2)) return r;
|
||||
|
||||
// Сохраняем состояние Canvas, чтобы не сломать нативную отрисовку LiteGraph
|
||||
ctx.save();
|
||||
|
||||
const getVal = (name, def) => {
|
||||
const w = this.widgets?.find(w => w.name === name);
|
||||
return w !== undefined ? w.value : def;
|
||||
@@ -223,10 +226,11 @@ app.registerExtension({
|
||||
widgets.forEach((widget, i) => {
|
||||
const rowY = widgetsY + i * (ROW_HEIGHT + ROW_GAP);
|
||||
|
||||
// Новый порядок: [label] [slider] [value] [reset]
|
||||
const labelX = padding + INNER_PADDING;
|
||||
const infoX = labelX + LABEL_WIDTH + INNER_PADDING;
|
||||
const sliderX = infoX + INFO_WIDTH + INNER_PADDING;
|
||||
const resetX = sliderX + sliderWidth + INNER_PADDING;
|
||||
const sliderX = labelX + LABEL_WIDTH + INNER_PADDING;
|
||||
const infoX = sliderX + sliderWidth + INNER_PADDING;
|
||||
const resetX = infoX + INFO_WIDTH + INNER_PADDING;
|
||||
|
||||
drawRoundedRect(ctx, padding, rowY, buttonWidth, ROW_HEIGHT, CORNER_RADIUS);
|
||||
ctx.fillStyle = "#252525";
|
||||
@@ -242,17 +246,6 @@ app.registerExtension({
|
||||
const labelText = `${widget.icon} ${widget.label}`;
|
||||
ctx.fillText(labelText, labelX, rowY + ROW_HEIGHT / 2);
|
||||
|
||||
const infoRect = { x: infoX, y: rowY + 2, w: INFO_WIDTH, h: ROW_HEIGHT - 4 };
|
||||
drawRoundedRect(ctx, infoX, rowY + 2, INFO_WIDTH, ROW_HEIGHT - 4, 4);
|
||||
ctx.fillStyle = "#3B3B3B";
|
||||
ctx.fill();
|
||||
|
||||
ctx.font = "12px monospace";
|
||||
ctx.fillStyle = "#e0e0e0";
|
||||
ctx.textAlign = "center";
|
||||
ctx.textBaseline = "middle";
|
||||
ctx.fillText(widget.format(widget.value), infoX + INFO_WIDTH / 2, rowY + ROW_HEIGHT / 2);
|
||||
|
||||
const sliderTrackY = rowY + ROW_HEIGHT / 2;
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(sliderX, sliderTrackY);
|
||||
@@ -276,6 +269,17 @@ app.registerExtension({
|
||||
ctx.lineWidth = 1;
|
||||
ctx.stroke();
|
||||
|
||||
const infoRect = { x: infoX, y: rowY + 2, w: INFO_WIDTH, h: ROW_HEIGHT - 4 };
|
||||
drawRoundedRect(ctx, infoX, rowY + 2, INFO_WIDTH, ROW_HEIGHT - 4, 4);
|
||||
ctx.fillStyle = "#3B3B3B";
|
||||
ctx.fill();
|
||||
|
||||
ctx.font = "12px monospace";
|
||||
ctx.fillStyle = "#e0e0e0";
|
||||
ctx.textAlign = "center";
|
||||
ctx.textBaseline = "middle";
|
||||
ctx.fillText(widget.format(widget.value), infoX + INFO_WIDTH / 2, rowY + ROW_HEIGHT / 2);
|
||||
|
||||
const resetRect = { x: resetX, y: rowY, w: RESET_WIDTH, h: ROW_HEIGHT };
|
||||
ctx.font = "12px Arial";
|
||||
ctx.textAlign = "center";
|
||||
@@ -313,6 +317,9 @@ app.registerExtension({
|
||||
|
||||
this.rs_resetAllRect = { x: padding, y: resetAllY, w: buttonWidth, h: resetAllHeight };
|
||||
|
||||
// Восстанавливаем состояние Canvas, чтобы не сломать нативную отрисовку LiteGraph
|
||||
ctx.restore();
|
||||
|
||||
return r;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user