Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow floating point for Horizontal and Vertical Rulers #800

Merged
merged 4 commits into from
Jan 1, 2023

Conversation

Variable-ind
Copy link
Contributor

Used stepify() function to restrict numbering up-to one decimal place

@@ -76,7 +76,7 @@ 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))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the difference between using stepify and simply removing int? I'm noticing the same result using both ways, either only whole numbers, or .5 numbers.

Copy link
Contributor Author

@Variable-ind Variable-ind Dec 31, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not much difference at the moment,
i noticed the floats became very long numbers (e.g 2.00001) etc if i change the sub-divisision variables
in short, using stepify is a more "General" solution

Copy link
Member

@OverloadedOrama OverloadedOrama left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@OverloadedOrama OverloadedOrama merged commit 5113963 into Orama-Interactive:master Jan 1, 2023
@Variable-ind Variable-ind deleted the float_guides branch January 4, 2023 12:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants