Repository navigation
FlxBar: Refresh rendering when fill direction changes - #3663
Merged
Merged
Conversation
Member
|
Thanks! Thanks, especially for adding tests; most contributors don't bother |
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.
Fixes #3256.
Changing
fillDirectioncurrently leaves the displayed bar unchanged, and subsequent redraws can reuse crop/destination offsets from the previous direction. Switching a right-to-left bar to left-to-right can therefore leave two filled sections.Reset the crop rectangle and destination point for each fill update, and redraw on direction assignment once the constructor has initialized the bar. This calls
updateBar()directly, so it does not reassign the value or trigger empty/full callbacks. Existing fill calculations are preserved.Regression coverage includes the issue's bordered 640×25 bar, immediate pixel placement, all 8×8 direction transitions with solid/bordered/gradient bars, and callback preservation at empty, partial and full values.
Validation with Haxe 4.3.7, Lime 8.3.2 and OpenFL 9.5.2:
DRAW_TILES) and Canvas (BLITTING): 6 passed in each. The three rendering regressions fail on the unchanged source in both modes.FlxGamesmoke scene renders switched-direction bars beside fresh reference bars; all eight pairs match pixel-for-pixel in both browser renderers after the fix.The complete HTML5 suite's browser execution hits an existing pre-main
FlxSoundTest/Lime Base64 initialization error on the unchanged base as well. Browser execution above uses the focused FlxBar suite; complete runtime coverage is from C++.