From fd27b3d5800bb452fb7ef0d7af435f1c8a83dd4e Mon Sep 17 00:00:00 2001 From: Chenlei Hu Date: Sun, 16 Feb 2025 21:48:02 -0500 Subject: [PATCH] Fix title editor font size (#2593) --- src/components/graph/TitleEditor.vue | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/components/graph/TitleEditor.vue b/src/components/graph/TitleEditor.vue index ec0ae2e44..93d5ae837 100644 --- a/src/components/graph/TitleEditor.vue +++ b/src/components/graph/TitleEditor.vue @@ -52,8 +52,10 @@ watch( } editedTitle.value = target.title showInput.value = true - previousCanvasDraggable.value = canvasStore.canvas!.allow_dragcanvas - canvasStore.canvas!.allow_dragcanvas = false + const canvas = canvasStore.canvas! + previousCanvasDraggable.value = canvas.allow_dragcanvas + canvas.allow_dragcanvas = false + const scale = canvas.ds.scale if (target instanceof LGraphGroup) { const group = target @@ -62,7 +64,7 @@ watch( pos: group.pos, size: [group.size[0], group.titleHeight] }, - { fontSize: group.font_size } + { fontSize: `${group.font_size * scale}px` } ) } else if (target instanceof LGraphNode) { const node = target @@ -72,7 +74,7 @@ watch( pos: [x, y], size: [node.width, LiteGraph.NODE_TITLE_HEIGHT] }, - { fontSize: 12 } + { fontSize: `${12 * scale}px` } ) } }