Fix linear flip.left.x / flip.right.x rendering on desktop pygame/SDL#21
Open
foonerd wants to merge 3 commits into
Open
Fix linear flip.left.x / flip.right.x rendering on desktop pygame/SDL#21foonerd wants to merge 3 commits into
foonerd wants to merge 3 commits into
Conversation
Parse flip flags as booleans, detach cached indicator surfaces before horizontal flip, and use image-local mask source coordinates.
Contributor
Author
|
@project-owner, @Gjuju - FYI |
After image-local reset_mask, previous_rect must start at content_x/y or the first volume union wipes from (0,0) and can flicker vinyl/cdart.
Owner
|
@foonerd, thank you for the changes! Just one comment, let's use the current naming convention and avoid underscore as a function name prefix (e.g. _get_optional_boolean etc). Thanks! |
Match PeppyMeter naming: get_optional_boolean, as_bool, flip_x.
Contributor
Author
|
@project-owner Thanks for the review, and for catching the naming. The leading underscores were only a Python “private helper” habit from my side ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
flip.left.x/flip.right.xas real booleans (aligned withleft.needle.flip/right.needle.flip), soFalseis no longer treated as enabled.convert_alpha()aftertransform.flipso the flipped indicator remains blit-safe on desktop pygame/SDL backends.Why
Horizontal flip for linear meters is applied in
LinearAnimator. On some pygame/SDL desktop configurations the flipped surface fails to blit useful pixels (indicator looks missing or unflipped). Stereo meters also commonly reuse one cached indicatorSurfacefor left and right; flipping without a detached copy is unsafe when both channels need independent content. Separately,reset_maskpreviously stored screen position in the blit source rect, which can yield an empty first paint.Benefit
flip.left.x/flip.right.xwork reliably for linear meters across embedded and desktop pygame/SDL hosts.flip.*.x = Falsemeans off (previously the non-empty string"False"was truthy).relax,steam-punk,fantasy, and custom themes) render as designed.Impact
LinearAnimator.__init__(meter start / theme change). Extra work isSurface.copy+transform.flip+ optionalconvert_alphaper flipped channel. No change to the per-framerun()path.Truekeeps working. ExplicitFalsenow correctly disables flip. Missing key remains off.Files
configfileparser.py- boolean parse helper for flip keyslinear.py- detached flip +convert_alphameter.py- default flip flags; image-localreset_mask