[Bugfix] UIDrawable base x/y/pos/grid_pos setters don't propagate dirty flags to parent #290
Labels
No labels
Alpha Release Requirement
Bugfix
Demo Target
Documentation
Major Feature
Minor Feature
priority:tier1-active
priority:tier2-foundation
priority:tier3-future
priority:tier4-deferred
Refactoring & Cleanup
system:animation
system:documentation
system:grid
system:input
system:performance
system:procgen
system:python-binding
system:rendering
system:ui-hierarchy
Tiny Feature
workflow:blocked
workflow:needs-benchmark
workflow:needs-documentation
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
john/McRogueFace#290
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Bug
UIDrawable::set_float_member()(the base class setter forxandyproperties, used by ALL drawable types) callsdrawable->onPositionChanged()but does NOT callmarkCompositeDirty()ormarkDirty().Similarly,
UIDrawable::set_pos()andUIDrawable::set_grid_pos()callonPositionChanged()without any dirty propagation.None of the
onPositionChanged()overrides (Frame, Caption, Sprite, Grid, Arc) call any dirty-flag method either — they only sync the SFML object's position.Affected code paths
UIDrawable::set_float_member()(x, y)onPositionChanged()UIDrawable::set_pos()onPositionChanged()UIDrawable::set_grid_pos()onPositionChanged()UIFrame::onPositionChanged()UICaption::onPositionChanged()UISprite::onPositionChanged()UIGrid::onPositionChanged()UIArc::onPositionChanged()Contrast with correct path
UIDrawable::applyAlignment()(line 2132-2134) does it right:Also,
UIDrawable::set_rotation()(line 632-633) correctly callsmarkDirty().UIDrawable::set_origin()(line 706) correctly callsmarkDirty(). Only position changes are missing it.Fix
The cleanest fix is to add
markCompositeDirty()toUIDrawable::set_float_member()after the position cases, and toset_pos()andset_grid_pos(). Position changes needmarkCompositeDirty()(not fullmarkContentDirty()) since the child's rendered content hasn't changed — only its position within the parent's composite.Impact
Affects ALL drawable types when they are children of a Frame with
clip_children=Trueorcache_subtree=True. Moving any child (.x = ...,.y = ...,.pos = ...) won't visually update.Related