Skip to content

Dark outline around dragged sprites #551

@adroitwhiz

Description

@adroitwhiz
Contributor

Expected Behavior

Sprites should have the same appearance when being dragged as when they're not being dragged

Actual Behavior

If you drag a sprite in the editor, a dark outline appears around it:
image

Note that this was not introduced by #515--as far as I can tell, it's always been a problem.

The problem is that extractDrawable returns data from gl.readPixels, which is premultiplied (and has been even before #515, which only moved the premultiplication out of the shader and into the texture upload). All DOM APIs which consume image data, on the other hand, expect non-premultiplied ("straight") alpha.

My first premultiplication PR (#460) added a new draw mode which "un-premultiplies" the alpha of drawn sprites, which I left out of the second in order to reduce the scope of the changes. I'll probably end up making a new PR with said "un-premultiplying" draw mode.

Steps to Reproduce

  1. Create a lightly-colored sprite
  2. Drag it

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @adroitwhiz

      Issue actions

        Dark outline around dragged sprites · Issue #551 · scratchfoundation/scratch-render