feat: Adding bleed option to SpriteBatch#3871
Draft
erickzanardo wants to merge 3 commits intomainfrom
Draft
Conversation
wolfenrain
reviewed
Mar 23, 2026
| required this.transform, | ||
| Color? color, | ||
| this.flip = false, | ||
| this.bleed = 0, |
Contributor
There was a problem hiding this comment.
We should do an assertion to prevent negative values
wolfenrain
reviewed
Mar 23, 2026
Comment on lines
+325
to
+327
| if (bleed == 0) { | ||
| return transform; | ||
| } |
Contributor
There was a problem hiding this comment.
Suggested change
| if (bleed == 0) { | |
| return transform; | |
| } | |
| if (bleed <= 0) { | |
| return transform; | |
| } |
wolfenrain
reviewed
Mar 23, 2026
Comment on lines
+334
to
+335
| final scos = transform.scos * scaleX; | ||
| final ssin = transform.ssin * scaleY; |
Contributor
There was a problem hiding this comment.
We should not scale by x or y but by math.max of either so we can preserve rotation (and ensure scale happens uniformly even if width and height are not equal).
And then the tx and ty should be multiplied by the scos and ssin (subtract for tx, addition for ty). That should keep the centerr fixed to bleed across the borders when we are dealing with rotation
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.
Description
Replace this text.
Checklist
docsand added dartdoc comments with///.examplesordocs.Breaking Change?
Related Issues