-
-
Notifications
You must be signed in to change notification settings - Fork 364
Improve text bounding boxes (fix empty Menu, Textbox issues) #5420
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
Conversation
Benchmark ResultsSHA: 36ce0633b0cb8c4edd6b04edce49c13c2598e446 Warning These results are subject to substantial noise because GitHub's CI runs on shared machines that are not ideally suited for benchmarking. |
|
This fails Makie.jl/Makie/src/makielayout/blocks/axis.jl Lines 1985 to 1989 in c9c5882
@jkrumbiegel Can't we calculate the pixel boundingbox of an Axis with decorations more directly from layoutobservables? Computedbbox with protrusions maybe? |
|
bbox + protrusions doesn't consider the font size so sometimes ticks can get cut off |

Description
This is a more low level fix for #5333. The errors in Menu and Textbox, and probably most around
round_to_IRect2Das well, happen because text bounding boxes return NaN (or Inf, -Inf) when a string is zero length. And that happens because we prematurely make text positions per character, effectively removing positions for empty strings.This pr reworks the text position pipeline to remain per-string as long as possible. They are then included in per-string (and plot) bounding boxes, changing them from Inf/NaN bounding boxes to
Rect3d(string_pos, Vec3d(0)). With that:raw_glyph_boundingboxes,fast_glyph_boundingboxesandglyph_boundingboxesshould be unchangedfast_string_boundingboxesnow returnRect3d(Point3d(NaN), Vec3d(0))instead ofRect3d(Point3d(Inf), Vec3d(-Inf))for an empty string (These skip positions)string_boundingboxesshould now always be finite (if positions are finite). Before empty strings resulted inRect3d(Point3d(NaN), Vec3d(0))full_boundingboxandboundingboxesnow consider empty strings to, i.e. include their position. All empty strings no longer results inRect3d(Point3d(Inf, Inf, 0), Vec3d(-Inf, -Inf, 0))Most of these are just plainly improvements imo. The only exception is the last case, where one might argue that an empty string should not be contributing to the bounding box of the plot, since it results in no visualization.
SliderGridobservables errors out #5392Labelinitialized with empty string does not show new text #5365Type of change
Maybe slightly breaking because
text.text_positionsgot deleted, and various other positions in text are now per-string instead of per-char. Though I'd consider those changes internal.Checklist