Repository navigation
SWR matplotlib__matplotlib-16710 - #64
richeshgupta wants to merge 1 commit into
Conversation
| [messagebox.layoutManager ensureLayoutForTextContainer: messagebox.textContainer]; | ||
| NSRect contentSize = [messagebox.layoutManager usedRectForTextContainer: messagebox.textContainer]; | ||
| rect = [messagebox frame]; | ||
| rect.origin.y = 0.5 * (self->height - contentSize.size.height); |
There was a problem hiding this comment.
[MEDIUM] Toolbar message is drawn outside the toolbar when wrapped text is taller than the toolbar
Issue
The added centering code computes rect.origin.y = 0.5 * (self->height - contentSize.size.height) with no bound on the laid-out text height, so any message that wraps past the 36pt toolbar height gets a negative origin.y; the frame height is never grown and the textview is not clipped, so the wrapped lines are drawn over the axes below the toolbar instead of inside it. set_message accepts an unbounded caller-supplied string, making this reachable in normal use.
Evidence
SUSPECTED: A test in the macosx backend that calls set_message with a ~200-character message and asserts the messagebox frame stays within the toolbar view's bounds would settle it.
SWRBench case matplotlib__matplotlib-16710: pinned base d0fc2e9 to head bfaa382 of matplotlib#16710. Benchmark replay, not for merge.