1
0
Fork 0
mirror of https://github.com/Orama-Interactive/Pixelorama.git synced 2025-01-31 07:29:49 +00:00

Fix ruler markings cutting off before they should

This commit is contained in:
Michael Alexsander 2020-02-16 19:51:46 -03:00
parent 30ce04b7f3
commit 97b197c41e
2 changed files with 2 additions and 2 deletions

View file

@ -58,7 +58,7 @@ func _draw() -> void:
first = (transform * ruler_transform * major_subdivide * minor_subdivide).affine_inverse().xform(Vector2.ZERO)
last = (transform * ruler_transform * major_subdivide * minor_subdivide).affine_inverse().xform(Global.main_viewport.rect_size)
for i in range(ceil(first.x), last.x):
for i in range(ceil(first.x), ceil(last.x)):
var position : Vector2 = (transform * ruler_transform * major_subdivide * minor_subdivide).xform(Vector2(i, 0))
if i % (major_subdivision * minor_subdivision) == 0:
draw_line(Vector2(position.x + RULER_WIDTH, 0), Vector2(position.x + RULER_WIDTH, RULER_WIDTH), Color.white)

View file

@ -53,7 +53,7 @@ func _draw() -> void:
first = (transform * ruler_transform * major_subdivide * minor_subdivide).affine_inverse().xform(Vector2.ZERO)
last = (transform * ruler_transform * major_subdivide * minor_subdivide).affine_inverse().xform(Global.main_viewport.rect_size)
for i in range(ceil(first.y), last.y):
for i in range(ceil(first.y), ceil(last.y)):
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)