[Documentation] Color sub-property assignment doesn't propagate (expected behavior) #174
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#174
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?
Summary
Assigning to color sub-properties like
caption.fill_color.g = 128doesn't work - the change is lost. This is expected behavior due to how Python C extensions work, but should be documented.Cause
When you access
obj.fill_color, the getter returns a new PyColor object containing a copy of the sf::Color. Modifications to that copy don't affect the original.Workarounds
1. Get, modify, set back
2. Use Animation for sub-properties (works correctly)
Possible Enhancements
fill_color_r,fill_color_g, etc. directly on drawablescaption.set_fill_color(g=128)with keyword argsAction Items