mirror of
https://github.com/Orama-Interactive/Pixelorama.git
synced 2025-01-31 07:29:49 +00:00
commit
4481cd9e99
|
@ -115,6 +115,7 @@ func _ready() -> void:
|
||||||
i += 1
|
i += 1
|
||||||
view_menu.set_item_checked(2, true) #Show Rulers
|
view_menu.set_item_checked(2, true) #Show Rulers
|
||||||
view_menu.set_item_checked(3, true) #Show Guides
|
view_menu.set_item_checked(3, true) #Show Guides
|
||||||
|
view_menu.hide_on_checkable_item_selection = false
|
||||||
i = 0
|
i = 0
|
||||||
for item in help_menu_items.keys():
|
for item in help_menu_items.keys():
|
||||||
help_menu.add_item(item, i, help_menu_items[item])
|
help_menu.add_item(item, i, help_menu_items[item])
|
||||||
|
|
|
@ -46,8 +46,11 @@ func _draw() -> void:
|
||||||
var position : Vector2 = (transform * ruler_transform * major_subdivide * minor_subdivide).xform(Vector2(0, i))
|
var position : Vector2 = (transform * ruler_transform * major_subdivide * minor_subdivide).xform(Vector2(0, i))
|
||||||
if i % (major_subdivision * minor_subdivision) == 0:
|
if i % (major_subdivision * minor_subdivision) == 0:
|
||||||
draw_line(Vector2(0, position.y), Vector2(RULER_WIDTH, position.y), Color.white)
|
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
|
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:
|
else:
|
||||||
if i % minor_subdivision == 0:
|
if i % minor_subdivision == 0:
|
||||||
draw_line(Vector2(RULER_WIDTH * 0.33, position.y), Vector2(RULER_WIDTH, position.y), Color.white)
|
draw_line(Vector2(RULER_WIDTH * 0.33, position.y), Vector2(RULER_WIDTH, position.y), Color.white)
|
||||||
|
|
Loading…
Reference in a new issue