2d-inc / support

Public issue tracker for 2Dimensions.com
4 stars 2 forks source link

Blending modes not working in flutter #234

Open snortblt opened 5 years ago

snortblt commented 5 years ago

Blending modes don't work properly or consistently in flutter. Using Dst Out mode, a flare animation appears to initially render correctly, clearing the regions where the content is filled/stroked white. However when the widget is redrawn, it draws the fill and stroke as if the blending mode is ignored.

Flutter 1.7.8+hotfix.3 • channel stable

luigi-rosso commented 5 years ago

Thanks for reporting this. Does this seem to afflict a single file or any Flare file using Dst Out blend mode?

luigi-rosso commented 5 years ago

I did a test here with an animated shape using Dst Out (which repaints every frame) and it seems to be working. Could you share any Flutter source and Flare file? You may have found an edge case that is difficult to reproduce. I'm wondering if you're using any repaint boundaries or are you animating the fill?

snortblt commented 5 years ago

It’s affected all three that I’ve tried so far. Seems to be the case even with no animations. I’ll see if I can create a simplest possible repro for you. It may be a few days before I can get to it.

luigi-rosso commented 5 years ago

Thanks for the assistance!

snortblt commented 5 years ago

Here's a sample project. The top icon's border should mask the bottom icons. I can't tell what the background should be, but it changes from black to white as soon as you drag to attempt scrolling the list view. Thanks for looking into this.

blend_repro.zip

luigi-rosso commented 5 years ago

Interesting, it seems like this has something to do with Flutter display lists used with repaint boundaries. If you set the ListView to not use repaint boundaries, it works:

ListView(
  addRepaintBoundaries: false,
  children: <Widget>[SizedBox( ...

image

Do you see this anywhere else or only when you place the Flare widget in a ListView or some other Repaint Boundary?