[Refactoring] Audit all Python property setters for missing markDirty() calls #291
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#291
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?
Problem
Issues #288, #289, and #290 reveal a systemic pattern: the render cache dirty-flag system (#144) was added to the C++
setProperty()animation path but not consistently to the Pythontp_getsetproperty setter path.The two code paths exist because:
setProperty(name, value)— C++ method, used by animation system. HasmarkDirty()everywhere.tp_getsetsetters — Python property accessors (e.g.,set_text,set_color_member). Some havemarkDirty(), some don't.Scope of audit
Every drawable type needs its Python setters checked:
setProperty()pathtp_getsetpathset_color_membercalls markDirty()set_text,set_color_member,set_float_memberdo NOTsetProperty()dispatchsetProperty()dispatchsetProperty()dispatchsetProperty()dispatchsetProperty()dispatchset_rotation,set_originOKset_float_member(x,y) missingRoot cause
The
setProperty()path was retrofitted with dirty flags in #144, buttp_getsetsetters were written earlier and weren't updated. Some types (Sprite, Circle, Line, Arc) use a unifiedsetProperty()dispatch even from tp_getset, so they're likely fine. Caption has its own legacy setters that bypasssetProperty()entirely.Recommended approach
tp_getsetsetter that modifies visual statemarkDirty()/markContentDirty()markCompositeDirty()onPositionChanged()should callmarkCompositeDirty()by default in the base class, eliminating the need for every caller to rememberRelated