Round drawable position#339
Merged
thisandagain merged 1 commit intoscratchfoundation:developfrom Oct 29, 2018
Merged
Conversation
Scratch 2 rendered sprite position is at whole numbers, while its vm position may be rational numbers.
Contributor
|
@cwillisf @mzgoddard Should this be merged for testing? |
Contributor
|
@cwillisf @mzgoddard is there a reason we haven't merged this? |
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.
Resolves
Fixes scratchfoundation/scratch-vm#1453
Proposed Changes
Round the sprite position received from the VM.
Reason for Changes
Scratch 2 rendered sprite position is at whole numbers, while its vm position may be rational numbers.
Reviewing https://github.com/LLK/scratch-flash/blob/develop/src/scratch/ScratchSprite.as#L180-L186 again I see the error I made in scratchfoundation/scratch-vm#1453.
xandyinScratchSprite.asare the rendering position.scratchXandscratchYare the vm position.xandyare defined by theSpriteclass thatScratchSpriteinherits from its parentScratchObj.Test Coverage
I haven't identified a project this improves yet. In theory it should fix projects with sprites with a 1-pixel blur because it is rendered with a rational position instead of a whole number position. It should also fix some high-precision issues with touching object and color. It may be one cause for these problems and not fix all instances of these issues.