GithubHelp home page GithubHelp logo

Antialiasing issues about lottie-flutter HOT 11 OPEN

xvrh avatar xvrh commented on July 26, 2024
Antialiasing issues

from lottie-flutter.

Comments (11)

wzono avatar wzono commented on July 26, 2024 1

In fill_content.dart I modify draw func,if is iOS and hasCircle use drawCircle instead of drawPath.

// canvas.drawPath(_path, _paint);
if(Platform.isIOS){
  if(hasCircle){
    var rect = _path.getBounds();
    canvas.drawCircle(rect.center,rect.width / 2,_paint);
  }else{
    canvas.drawPath(_path, _paint);
  }
}else{
  canvas.drawPath(_path, _paint);
}

It is not very well solution,but can solve my problem.Hope it can help you.

How do I know about hasCircle?

from lottie-flutter.

binqiiyuenan avatar binqiiyuenan commented on July 26, 2024

I had the same problem with my iPhone 11Pro, which worked well on Android

from lottie-flutter.

kkizlaitis avatar kkizlaitis commented on July 26, 2024

I also saw that it doesn't matter what the size of the animation is. My device was iPhone X (not a simulator).

from lottie-flutter.

binqiiyuenan avatar binqiiyuenan commented on July 26, 2024

Yes, it has nothing to do with size. Have you found a solution later

from lottie-flutter.

kkizlaitis avatar kkizlaitis commented on July 26, 2024

Not yet, for now I left it like that... Input from @xvrh would be greatly appreciated 😊

from lottie-flutter.

binqiiyuenan avatar binqiiyuenan commented on July 26, 2024

I covered the serrate with a line of the same color to solve this problem on the iPhone, I hope it helps you.

from lottie-flutter.

AndrewsXc avatar AndrewsXc commented on July 26, 2024

I encountered the same aliasing problem on iPhone 11 devices with lottie 0.7.0+1.
And I found that this happens only in iOS 14.

from lottie-flutter.

lifelikejuly avatar lifelikejuly commented on July 26, 2024

I have same problem.but it cant find in Android.
I see circle draw use path to do will have Antialiasing.

from lottie-flutter.

lifelikejuly avatar lifelikejuly commented on July 26, 2024

In fill_content.dart I modify draw func,if is iOS and hasCircle use drawCircle instead of drawPath.

// canvas.drawPath(_path, _paint);
if(Platform.isIOS){
  if(hasCircle){
    var rect = _path.getBounds();
    canvas.drawCircle(rect.center,rect.width / 2,_paint);
  }else{
    canvas.drawPath(_path, _paint);
  }
}else{
  canvas.drawPath(_path, _paint);
}

It is not very well solution,but can solve my problem.Hope it can help you.

from lottie-flutter.

lifelikejuly avatar lifelikejuly commented on July 26, 2024

In fill_content.dart I modify draw func,if is iOS and hasCircle use drawCircle instead of drawPath.

// canvas.drawPath(_path, _paint);
if(Platform.isIOS){
  if(hasCircle){
    var rect = _path.getBounds();
    canvas.drawCircle(rect.center,rect.width / 2,_paint);
  }else{
    canvas.drawPath(_path, _paint);
  }
}else{
  canvas.drawPath(_path, _paint);
}

It is not very well solution,but can solve my problem.Hope it can help you.

How do I know about hasCircle?

Find CircleShape and you can see EllipseContent.
If fill_content has EllipseContent mean have circle.

from lottie-flutter.

eggfly avatar eggfly commented on July 26, 2024
if(Platform.isIOS){
  final hasCircle = _path.any((path) {
    return path is EllipseContent;
  });
  if(hasCircle){
    var rect = _path.getBounds();
    canvas.drawCircle(rect.center,rect.width / 2,_paint);
  }else{
    canvas.drawPath(_path, _paint);
  }
}else{
  canvas.drawPath(_path, _paint);
}

This code may work but it needs some more tests

from lottie-flutter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.