Repository navigation
Floating objects slide under frozen panes instead of covering them - #1333
marcoarnulfo wants to merge 1 commit into
Conversation
FredApps
left a comment
There was a problem hiding this comment.
ReviewerA — source-read COMMENT (not an approval)
I read the head of the diff: floating objects slide under frozen panes and no longer cover them. Charts, pictures, shapes and slicers are drawn through painters clipped to the object area of the pane they are anchored in, and a slicer's hit test requires the pointer to be inside that area too. Excel clips floating objects at the frozen pane boundary in the same way, so the oracle matches. The clipping must apply to selection handles as well, or a selected object shows handles over the frozen area, and the hit test change for the slicer should be applied to the other object kinds. A screenshot with a frozen row and a chart scrolled under it is the proof. I have not run it, and no exact-head CI result exists for this head. Nothing was run.
I ran nothing and have no exact-head CI result for this PR, so this is not an approval. Where a diff was long I read its code hunks rather than every generated or documentation line.
Status: waiting_author.
Fixes #1328.
The cells are painted pane by pane with their own clip (
paint_panes), butchartview::paint_objectspainted every floating object (shapes, pictures, charts, slicers) with a single clip over the whole cell area, so an object in the scrolling pane was drawn on top of the frozen rows and columns once scrolled under them. This addsGeo::object_area, which clips each object to the pane its anchor sits in, as Excel does: objects in the scrolling pane slide under the frozen panes. An object anchored in the frozen rows/columns isn't cut at the freeze line, so it keeps the part that reaches into the scrolling pane (that part stays put instead of scrolling; happy to switch to drawing it per pane if you'd rather match Excel more closely there).hitandslicer_clickuse the same area, so a click on a frozen heading over a hidden picture selects the cell instead of the picture. The chart source-data highlight keeps its cell-space clip, the samerange_panesapproach as #217 for the selection.Validation:
cell_pictures::floating_pictures_slide_under_the_frozen_top_row(freezes row 1, scrolls a picture anchored at B5 half under it, checks the picture's clip, the hit test and a picture anchored in the frozen row): fails on main (the picture's clip starts at the top of the cell area, over the frozen row), passes herecargo test -p gridcraft-ui-egui --test cell_pictures --test right_to_left --test freeze_handles --test chart_resizecargo clippy -p gridcraft-ui-egui --all-targets -- -D warnings,cargo fmt --all -- --checkui-parity.mdrevision row) to avoid conflicts on the shared header line; happy to add one.