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

Fix the is_run_visible calculation #134

Merged
merged 4 commits into from
Mar 5, 2025

Conversation

StratusFearMe21
Copy link
Contributor

@StratusFearMe21 StratusFearMe21 commented Mar 4, 2025

I'm fairly sure this calculation isn't correct (thought I may be wrong). If I recall correctly, the text_area bounds are supposed to be in physical pixels, while the run_line is in logical pixels.

In a nutshell, my program had problems before this fix, now it doesn't.

Copy link
Owner

@grovesNL grovesNL left a comment

Choose a reason for hiding this comment

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

This seems good assuming the physical/logical units are correct.

It would be nice if we could create a simple example to show the fixed behavior (mostly for testing if we change any of this accidentally later on).

@grovesNL grovesNL merged commit fa9a3f8 into grovesNL:main Mar 5, 2025
1 check passed
hecrj pushed a commit to iced-rs/cryoglyph that referenced this pull request Mar 8, 2025
* Fix the `is_run_visible` calculation

* Clarify variable names in the `is_run_visible` calculation

* Make the physical run_line scales `i32` instead of `f32`

* Make entire `start_y_physical` expression in `is_run_visible` calculation an `i32`
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