Repository navigation
Notify slider observers before redrawing in set_val - #32587
huzaifarahman13 wants to merge 1 commit into
Conversation
|
Thank you for opening your first PR into Matplotlib! If you have not heard from us in a week or so, please leave a new comment below and that should bring it to our attention. Most of our reviewers are volunteers and sometimes things fall through the cracks. We also ask that you please finish addressing any review comments on this PR and wait for it to be merged (or closed) before opening a new one, as it can be a valuable learning experience to go through the review process. You can also join us on discourse chat for real-time discussion. For details on testing, writing docs, and our review process, please see the developer guide. We strive to be a welcoming and open project. Please follow our Code of Conduct. |
PR summary
Closes #32526
Slider.set_valandRangeSlider.set_valcalleddraw_idle()before notifying theon_changedobservers. Because of that, the first redraw showed stale state for any artists that were updated inside the callback.This PR moves the redraw so it happens after the observers are notified, in both methods. Behaviour with
drawon=Falseis unchanged.I added
test_slider_set_val_notifies_before_draw, which checks that the callback runs before the draw for both sliders, withdrawonset to True and False. It fails on main and passes with this change.AI Disclosure
I used an AI assistant to help locate the code and draft the change and test. I reviewed and ran everything locally and understand the change.
PR quality check