1
0
Fork 0
mirror of https://github.com/Orama-Interactive/Pixelorama.git synced 2025-01-18 17:19:50 +00:00

Merge pull request #1 from Orama-Interactive/master

Stay up to date
This commit is contained in:
Erevos 2019-12-20 03:39:25 +02:00 committed by GitHub
commit 4481cd9e99
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View file

@ -115,6 +115,7 @@ func _ready() -> void:
i += 1
view_menu.set_item_checked(2, true) #Show Rulers
view_menu.set_item_checked(3, true) #Show Guides
view_menu.hide_on_checkable_item_selection = false
i = 0
for item in help_menu_items.keys():
help_menu.add_item(item, i, help_menu_items[item])

View file

@ -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)