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

Sub-pixel precision for shape position and size #686

Closed
jcoliz opened this issue May 16, 2024 · 1 comment
Closed

Sub-pixel precision for shape position and size #686

jcoliz opened this issue May 16, 2024 · 1 comment

Comments

@jcoliz
Copy link
Contributor

jcoliz commented May 16, 2024

I'm doing a lot of work that revolves around precisely centering groups of shapes on both axes. Integer precision is insufficient for this. You can really tell looking at the slides that the centering is off by one pixel here and there.

This has been fixed perfectly by using sub-pixel positioning and sizing. Prototype here: https://github.com/jcoliz/ShapeCrawler/tree/topic/decimal-positioning . I did this using decimals, but afterward I'm not convinced decimal is any better than double in this application.

Would like to contribute this back. Question for @ashahabov , how would you prefer it done?

  1. Change int to double universally for size and position
  2. Add separate properties for backward compat (this is how I did it my prototype)
  3. Something else?
@ashahabov
Copy link
Member

Let's convert IPosition.X and other position and size properties into decimal type. In the future, if there are any complaints about performance, we will add some IPosition.FloatX.

jcoliz added a commit to jcoliz/ShapeCrawler that referenced this issue May 16, 2024
jcoliz added a commit to jcoliz/ShapeCrawler that referenced this issue May 20, 2024
I already did them, just neglected to remove them.

Related to ShapeCrawler#686
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: To Do
Development

No branches or pull requests

2 participants