From 7d1b72aa58d00281c5cb6b1e8aac59c158d7f085 Mon Sep 17 00:00:00 2001 From: Michael Alexsander Date: Thu, 19 Dec 2019 19:23:08 -0300 Subject: [PATCH] Make the vertical ruler show its values vertically --- Scripts/VerticalRuler.gd | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Scripts/VerticalRuler.gd b/Scripts/VerticalRuler.gd index 4757c4ff9..ee9b308c6 100644 --- a/Scripts/VerticalRuler.gd +++ b/Scripts/VerticalRuler.gd @@ -46,8 +46,11 @@ func _draw() -> void: var position : Vector2 = (transform * ruler_transform * major_subdivide * minor_subdivide).xform(Vector2(0, i)) if i % (major_subdivision * minor_subdivision) == 0: draw_line(Vector2(0, position.y), Vector2(RULER_WIDTH, position.y), Color.white) + 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, i)).y - draw_string(font, Vector2(0, position.y - 2), str(int(val))) + draw_string(font, Vector2(), str(int(val))) + draw_set_transform_matrix(get_transform()) else: if i % minor_subdivision == 0: draw_line(Vector2(RULER_WIDTH * 0.33, position.y), Vector2(RULER_WIDTH, position.y), Color.white)