diff options
| author | metamuffin <metamuffin@disroot.org> | 2025-10-14 19:47:58 +0200 |
|---|---|---|
| committer | metamuffin <metamuffin@disroot.org> | 2025-10-14 19:47:58 +0200 |
| commit | c5d38dd22d08ae1e828664788be4b3d258e0ebdc (patch) | |
| tree | ac54333e64d76d697f48e01ff4346e70f1e3a1f8 /client | |
| parent | 36aee28abcb14375336db70c2fba47deaf598c9d (diff) | |
| download | hurrycurry-c5d38dd22d08ae1e828664788be4b3d258e0ebdc.tar hurrycurry-c5d38dd22d08ae1e828664788be4b3d258e0ebdc.tar.bz2 hurrycurry-c5d38dd22d08ae1e828664788be4b3d258e0ebdc.tar.zst | |
Scale diagram idenpendently on axis
Diffstat (limited to 'client')
| -rw-r--r-- | client/gui/menus/book/diagram.gd | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/client/gui/menus/book/diagram.gd b/client/gui/menus/book/diagram.gd index f1f19399..abd22a01 100644 --- a/client/gui/menus/book/diagram.gd +++ b/client/gui/menus/book/diagram.gd @@ -75,15 +75,9 @@ func redraw_images() -> void: func scale(bounds: Rect2) -> void: var current := Rect2(Vector2(INF, INF), Vector2(-INF, -INF)) for n: DiagramNode in draw_nodes: - if n.position.x < current.position.x: - current.position.x = n.position.x - if n.position.y < current.position.y: - current.position.y = n.position.y - if n.position.x > current.end.x: - current.end.x = n.position.x - if n.position.y > current.end.y: - current.end.y = n.position.y - var s := bounds.size / current.size + current.position = current.position.min(n.position) + current.end = current.end.max(n.position) + var s = Vector2.ONE.min(bounds.size / current.size) for n: DiagramNode in nodes: var p := n.position p -= current.position |