Comments (1)
Thanks @4mitabh, I'm happy you like it!
Let me see if I understood correctly: You would like to have a callback which fires one frame before a specific part of a Path element is painted so that you can overlay something (e.g. a drawing hand which points to the end of the stroke).
As far as I understand it this is not possible:
Since the animation is controlled by an animation controller (possibly provided externally) I can't predict which element will be drawn beforehand (e.g. the animation controller can forward/reverse anytime). So if I would expose the callback as you described, then your overlay would always lag one frame behind.
But I will think about it a little bit more during the next days and possibly figure out a workaround. The first idea that comes to my mind is providing a callback which extends the current paint operation but still operating in the same frame. But this would mean that you need to manipulate the canvas directly (in your case probably something with drawImage). So your desired callback would be something like this:
onFrame:((canvas, pathSegment) => canvas.drawImage(img,pathSegment.path.computeMetrics().first.extractPath(length*0.99,length).getBounds().center, Paint()))
from drawing_animation.
Related Issues (20)
- Please publish to pub.dev the new version HOT 1
- Is it possible to use it as progress bar? HOT 1
- Loading SVG via network not possible HOT 2
- Upgrade to null safety HOT 1
- Unhandled Exception: NoSuchMethodError: The getter 'isNotEmpty' was called on null.
- NoSuchMethodError: The getter 'isNotEmpty' was called on null HOT 4
- Add null safety support HOT 3
- version solving failed HOT 2
- Can i get at any point or continues path value and time.
- Build getting failed with Flutter version 2.10.2
- Only hex color format currently supported HOT 1
- Unsupported operation: Only hex color format currently supported. String: url(#a)
- Update needed! HOT 1
- Problem with colors HOT 3
- Implement complete SVG parsing HOT 1
- SVG being cropped HOT 4
- Missing support for flutter for web HOT 1
- Erase animation for SVGs HOT 2
- update to newer "xml" dep version to be compatible with flutter 1.20 and flutter-svg 0.18.0
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from drawing_animation.