File tree Expand file tree Collapse file tree 2 files changed +16
-3
lines changed
app/gui/src/project-view/components Expand file tree Collapse file tree 2 files changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -45,6 +45,7 @@ const COMPONENT_EDITOR_PADDING = NODE_CONTENT_PADDING
45
45
const ICON_WIDTH = 24
46
46
// Component editor is larger than a typical node, so the edge should touch it a bit higher.
47
47
const EDGE_Y_OFFSET = - 8
48
+ const MIN_WIDTH = 295
48
49
49
50
const cssComponentEditorPadding = ` ${COMPONENT_EDITOR_PADDING }px `
50
51
@@ -162,6 +163,13 @@ const transform = computed(() => {
162
163
return ` translate(${x }px, ${y }px) `
163
164
})
164
165
166
+ const minWidth = computed (() => {
167
+ if (props .usage .type !== ' editNode' ) return ` ${MIN_WIDTH }px `
168
+ const rect = graphStore .nodeRects .get (props .usage .node )
169
+ if (rect == null ) return ` ${MIN_WIDTH }px `
170
+ return ` ${rect .width * props .navigator .scale }px `
171
+ })
172
+
165
173
// === Selection ===
166
174
167
175
const selected = ref <Component | null >(null )
@@ -375,7 +383,7 @@ const listsHandler = listBindings.handler({
375
383
<div
376
384
ref =" cbRoot"
377
385
class =" ComponentBrowser"
378
- :style =" { transform }"
386
+ :style =" { transform, minWidth }"
379
387
:data-self-argument =" input.selfArgument"
380
388
tabindex =" -1"
381
389
@focusout =" handleDefocus"
@@ -443,7 +451,6 @@ const listsHandler = listBindings.handler({
443
451
--radius-default : 20px ;
444
452
--background-color : #fff ;
445
453
--doc-panel-bottom-clip : 4px ;
446
- min-width : 295px ;
447
454
width : min-content ;
448
455
color : rgba (0 , 0 , 0 , 0.6 );
449
456
font-size : 11.5px ;
Original file line number Diff line number Diff line change @@ -430,6 +430,7 @@ const nodeClass = computed(() => {
430
430
outputNode: props .node .type === ' output' ,
431
431
menuVisible: menuVisible .value ,
432
432
menuFull: menuFull .value ,
433
+ edited: props .edited ,
433
434
}
434
435
})
435
436
@@ -489,7 +490,6 @@ onWindowBlur(() => {
489
490
490
491
<template >
491
492
<div
492
- v-show =" !edited"
493
493
ref =" rootNode"
494
494
class =" GraphNode define-node-colors"
495
495
:style =" nodeStyle"
@@ -730,4 +730,10 @@ onWindowBlur(() => {
730
730
.dragged {
731
731
cursor : grabbing !important ;
732
732
}
733
+
734
+ /* We use this instead of "v-show", because we want the node content being still laid out,
735
+ so the edges won't jump. */
736
+ .edited {
737
+ visibility : hidden ;
738
+ }
733
739
</style >
You can’t perform that action at this time.
0 commit comments