From e050f1e76be18c0d6b7e3e660f0564365cdd8e2e Mon Sep 17 00:00:00 2001 From: Variable <77773850+Variable-ind@users.noreply.github.com> Date: Wed, 28 Dec 2022 21:31:50 +0500 Subject: [PATCH 1/4] Allow floating point for HRuler --- src/UI/Canvas/Rulers/HorizontalRuler.gd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/UI/Canvas/Rulers/HorizontalRuler.gd b/src/UI/Canvas/Rulers/HorizontalRuler.gd index 9f648089829..0078d1230aa 100644 --- a/src/UI/Canvas/Rulers/HorizontalRuler.gd +++ b/src/UI/Canvas/Rulers/HorizontalRuler.gd @@ -76,7 +76,7 @@ func _draw() -> void: ) var val = (ruler_transform * major_subdivide * minor_subdivide).xform(Vector2(j, 0)).x draw_string( - font, Vector2(position.x + RULER_WIDTH + 2, font.get_height() - 4), str(int(val)) + font, Vector2(position.x + RULER_WIDTH + 2, font.get_height() - 4), str(stepify(val, 0.1)) ) else: if j % minor_subdivision == 0: From 0e024f6d3d6b50278dced468f56155af047de7c2 Mon Sep 17 00:00:00 2001 From: Variable <77773850+Variable-ind@users.noreply.github.com> Date: Wed, 28 Dec 2022 21:35:02 +0500 Subject: [PATCH 2/4] Allow floating point for VRuler --- src/UI/Canvas/Rulers/VerticalRuler.gd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/UI/Canvas/Rulers/VerticalRuler.gd b/src/UI/Canvas/Rulers/VerticalRuler.gd index 9a1a579653b..8cd12064cb8 100644 --- a/src/UI/Canvas/Rulers/VerticalRuler.gd +++ b/src/UI/Canvas/Rulers/VerticalRuler.gd @@ -73,7 +73,7 @@ func _draw() -> void: var text_xform = Transform2D(-PI / 2, Vector2(font.get_height() - 4, position.y - 2)) draw_set_transform_matrix(get_transform() * text_xform) var val = (ruler_transform * major_subdivide * minor_subdivide).xform(Vector2(0, j)).y - draw_string(font, Vector2(), str(int(val))) + draw_string(font, Vector2(), str(stepify(val, 0.1))) draw_set_transform_matrix(get_transform()) else: if j % minor_subdivision == 0: From ab0dbefd09c650d032f5625a231b483a3e326e69 Mon Sep 17 00:00:00 2001 From: Emmanouil Papadeas <35376950+OverloadedOrama@users.noreply.github.com> Date: Sun, 1 Jan 2023 19:47:38 +0200 Subject: [PATCH 3/4] Formatting --- src/UI/Canvas/Rulers/HorizontalRuler.gd | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/UI/Canvas/Rulers/HorizontalRuler.gd b/src/UI/Canvas/Rulers/HorizontalRuler.gd index 0078d1230aa..d7dd8991603 100644 --- a/src/UI/Canvas/Rulers/HorizontalRuler.gd +++ b/src/UI/Canvas/Rulers/HorizontalRuler.gd @@ -76,8 +76,10 @@ func _draw() -> void: ) var val = (ruler_transform * major_subdivide * minor_subdivide).xform(Vector2(j, 0)).x draw_string( - font, Vector2(position.x + RULER_WIDTH + 2, font.get_height() - 4), str(stepify(val, 0.1)) - ) + font, + Vector2(position.x + RULER_WIDTH + 2, font.get_height() - 4), + str(stepify(val, 0.1)) + ) else: if j % minor_subdivision == 0: draw_line( From a803d0e2263edf74732a694b832850e300fab651 Mon Sep 17 00:00:00 2001 From: Emmanouil Papadeas <35376950+OverloadedOrama@users.noreply.github.com> Date: Sun, 1 Jan 2023 19:49:25 +0200 Subject: [PATCH 4/4] Format again --- src/UI/Canvas/Rulers/HorizontalRuler.gd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/UI/Canvas/Rulers/HorizontalRuler.gd b/src/UI/Canvas/Rulers/HorizontalRuler.gd index d7dd8991603..7c6e6297e1a 100644 --- a/src/UI/Canvas/Rulers/HorizontalRuler.gd +++ b/src/UI/Canvas/Rulers/HorizontalRuler.gd @@ -79,7 +79,7 @@ func _draw() -> void: font, Vector2(position.x + RULER_WIDTH + 2, font.get_height() - 4), str(stepify(val, 0.1)) - ) + ) else: if j % minor_subdivision == 0: draw_line(