BUG: Fix box_handle_props initialization in PolygonSelector#31718
Merged
Conversation
QuLogic
reviewed
May 21, 2026
45071c9 to
c66fb6a
Compare
QuLogic
approved these changes
May 23, 2026
c66fb6a to
1e50bb2
Compare
ksunden
reviewed
May 29, 2026
Comment on lines
+1748
to
+1749
| assert box_artist.get_facecolor() == mcolors.to_rgba('c') | ||
| assert box_artist.get_edgecolor() == mcolors.to_rgba('b') |
Member
There was a problem hiding this comment.
Suggested change
| assert box_artist.get_facecolor() == mcolors.to_rgba('c') | |
| assert box_artist.get_edgecolor() == mcolors.to_rgba('b') | |
| assert mcolors.same_color(box_artist.get_facecolor(), 'c') | |
| assert mcolors.same_color(box_artist.get_edgecolor(), 'b') |
Two more color checks
Contributor
Author
There was a problem hiding this comment.
I overlooked those. Updated now.
1e50bb2 to
8a06e06
Compare
ksunden
approved these changes
May 29, 2026
QuLogic
pushed a commit
that referenced
this pull request
May 30, 2026
QuLogic
added a commit
that referenced
this pull request
May 30, 2026
…718-on-v3.11.x Backport PR #31718 on branch v3.11.x (BUG: Fix box_handle_props initialization in PolygonSelector)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR summary
This PR fixes a bug in PolygonSelector where
box_handle_propsis incorrectly set to None because dict.update() returns None. Discovered while working on #31623.Why is this change necessary? / What problem does it solve?
When using PolygonSelector with
draw_bounding_box=True, any providedbox_handle_propsare not applied correctly. Instead the bounding box handles fall back to default props from RectangleSelector.What is the reasoning for this implementation?
The fix ensures
box_handle_propsinherits fromhandle_props, overrides are applied correctly, and the originalhandle_propsdictionary is not mutated.Example
The issue can be reproduced by specifying
box_handle_props:AI Disclosure
None.
PR checklist