-
-
Notifications
You must be signed in to change notification settings - Fork 21.1k
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
Improve TextureRegionEditor #61429
Improve TextureRegionEditor #61429
Conversation
hscroll->set_value((hscroll->get_min() + hscroll->get_max() - hscroll->get_page()) / 2); | ||
vscroll->set_value((vscroll->get_min() + vscroll->get_max() - vscroll->get_page()) / 2); | ||
// This ensures that the view is updated correctly. | ||
callable_bind(callable_mp(this, &TextureRegionEditor::_pan_callback), Vector2(1, 0)).call_deferred(nullptr, 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't believe centering on the texture was so difficult. I resorted to this hack, anything better would require some bigger rewrite of the scroll logic.
One of the problems was that the scrollbars are initialized to their final value after a second update, hence the hscroll->get_min() < 0
part.
looks great to me! |
Is there a reason not to always use the percentage rather than the relative unit for zooming? |
Thanks! |
Follow-up to #61342