mirror of
https://github.com/Orama-Interactive/Pixelorama.git
synced 2025-01-18 17:19:50 +00:00
Allow floating point for Horizontal and Vertical Rulers (#800)
* Allow floating point for HRuler * Allow floating point for VRuler * Formatting * Format again Co-authored-by: Emmanouil Papadeas <35376950+OverloadedOrama@users.noreply.github.com>
This commit is contained in:
parent
cbeef73fac
commit
5113963f64
|
@ -76,7 +76,9 @@ 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:
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue