Skip to content

Commit d82bfad

Browse files
committed
TEMP: minimap debug overlay
1 parent a8f2c97 commit d82bfad

1 file changed

Lines changed: 29 additions & 7 deletions

File tree

node-editor-building-blocks.slint

Lines changed: 29 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ export component Minimap inherits Rectangle {
328328
// === Styling ===
329329
in property <length> minimap-width: 200px;
330330
in property <length> minimap-height: 150px;
331-
in property <color> minimap-background-color: #1a1a1aee;
331+
in property <color> minimap-background-color: #1a1a1aff;
332332
in property <color> minimap-node-color: #4a4a4a;
333333
in property <color> minimap-viewport-border-color: #ffffff;
334334
in property <length> minimap-viewport-border-width: 2px;
@@ -374,10 +374,10 @@ export component Minimap inherits Rectangle {
374374
root.available-height / root.content-height);
375375

376376
// === Viewport Indicator in Minimap Coordinates ===
377-
property <length> viewport-indicator-x: root.minimap-padding + (root.visible-min-x - root.content-min-x) * root.scale;
378-
property <length> viewport-indicator-y: root.minimap-padding + (root.visible-min-y - root.content-min-y) * root.scale;
379-
property <length> viewport-indicator-width: (root.visible-max-x - root.visible-min-x) * root.scale;
380-
property <length> viewport-indicator-height: (root.visible-max-y - root.visible-min-y) * root.scale;
377+
out property <length> viewport-indicator-x: root.minimap-padding + (root.visible-min-x - root.content-min-x) * root.scale;
378+
out property <length> viewport-indicator-y: root.minimap-padding + (root.visible-min-y - root.content-min-y) * root.scale;
379+
out property <length> viewport-indicator-width: (root.visible-max-x - root.visible-min-x) * root.scale;
380+
out property <length> viewport-indicator-height: (root.visible-max-y - root.visible-min-y) * root.scale;
381381

382382
width: root.minimap-width;
383383
height: root.minimap-height;
@@ -423,11 +423,33 @@ export component Minimap inherits Rectangle {
423423
y: root.viewport-indicator-y;
424424
width: root.viewport-indicator-width;
425425
height: root.viewport-indicator-height;
426-
background: transparent;
427-
border-color: root.minimap-viewport-border-color;
426+
background: #ff000055;
427+
border-color: red;
428428
border-width: root.minimap-viewport-border-width;
429429
}
430430

431+
// TEMP DEBUG: overlay with actual numeric values — positioned ABOVE the minimap
432+
Rectangle {
433+
x: -260px;
434+
y: 0px;
435+
width: 260px;
436+
height: 100px;
437+
background: white;
438+
Text {
439+
x: 2px;
440+
y: 2px;
441+
text: "vpw=" + round(root.viewport-width / 1px) + " vpz=" + round(root.viewport-zoom * 1000) / 1000
442+
+ "\nscale=" + round(root.scale * 10000) / 10000
443+
+ "\ncontent-w=" + round(root.content-width / 1px)
444+
+ "\ncontent-min=" + round(root.content-min-x / 1px) + "," + round(root.content-min-y / 1px)
445+
+ "\nvis-min=" + round(root.visible-min-x / 1px) + "," + round(root.visible-min-y / 1px)
446+
+ "\nind x=" + round(root.viewport-indicator-x / 1px) + " w=" + round(root.viewport-indicator-width / 1px)
447+
+ "\nind y=" + round(root.viewport-indicator-y / 1px) + " h=" + round(root.viewport-indicator-height / 1px);
448+
color: black;
449+
font-size: 11px;
450+
}
451+
}
452+
431453
TouchArea {
432454
width: 100%;
433455
height: 100%;

0 commit comments

Comments
 (0)