mirror of
https://github.com/xvrh/lottie-flutter.git
synced 2025-08-06 16:39:36 +08:00
Compare commits
15 Commits
Author | SHA1 | Date | |
---|---|---|---|
dc43a532b0 | |||
1b752bf341 | |||
21f34e6334 | |||
8dcb052fe1 | |||
a333a42f01 | |||
8ce429cdf4 | |||
fc450a88f4 | |||
c0bc257f4f | |||
0e7499d82e | |||
4cd9ec759a | |||
d8f5b872ef | |||
bc3eb4621b | |||
08d7da747a | |||
b2ebd2058d | |||
2979b62dc0 |
15
.github/workflows/analyze-and-test.yaml
vendored
15
.github/workflows/analyze-and-test.yaml
vendored
@ -10,11 +10,11 @@ jobs:
|
||||
name: Flutter analyze
|
||||
strategy:
|
||||
matrix:
|
||||
flutter: ['beta']
|
||||
flutter: ['stable']
|
||||
runs-on: macos-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: subosito/flutter-action@v1
|
||||
- uses: subosito/flutter-action@v2
|
||||
with:
|
||||
channel: ${{ matrix.flutter }}
|
||||
- run: flutter doctor
|
||||
@ -22,8 +22,8 @@ jobs:
|
||||
- run: flutter pub get
|
||||
working-directory: example
|
||||
- run: flutter analyze
|
||||
- run: flutter test test # https://github.com/flutter/flutter/issues/20907
|
||||
- run: flutter test test
|
||||
- run: flutter test
|
||||
- run: flutter test
|
||||
working-directory: example
|
||||
- run: flutter pub run tool/prepare_submit.dart
|
||||
- name: "check for uncommitted changes"
|
||||
@ -34,14 +34,13 @@ jobs:
|
||||
&& exit 1)
|
||||
shell: bash
|
||||
build_web_version:
|
||||
name: Check that the web version compile
|
||||
name: Check that the web version can compile
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: subosito/flutter-action@v1
|
||||
- uses: subosito/flutter-action@v2
|
||||
with:
|
||||
channel: 'beta'
|
||||
- run: flutter config --enable-web
|
||||
channel: 'stable'
|
||||
- run: flutter precache web
|
||||
- run: flutter pub get
|
||||
working-directory: example
|
||||
|
4
.github/workflows/publish-on-pub.yaml
vendored
4
.github/workflows/publish-on-pub.yaml
vendored
@ -8,9 +8,9 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: subosito/flutter-action@v1
|
||||
- uses: subosito/flutter-action@v2
|
||||
with:
|
||||
channel: 'beta'
|
||||
channel: 'stable'
|
||||
- run: flutter pub get
|
||||
- run: flutter pub run tool/publish/comment_dependency_overrides.dart
|
||||
- run: flutter pub get
|
||||
|
1
.gitignore
vendored
1
.gitignore
vendored
@ -3,6 +3,7 @@ _*
|
||||
|
||||
!.gitignore
|
||||
!.github
|
||||
!.pubignore
|
||||
|
||||
**/failures/*.png
|
||||
|
||||
|
15
.pubignore
Normal file
15
.pubignore
Normal file
@ -0,0 +1,15 @@
|
||||
.dart_tool/
|
||||
.packages
|
||||
build/
|
||||
doc/api/
|
||||
*.iml
|
||||
_*
|
||||
.*
|
||||
**/failures/*.png
|
||||
test/golden/
|
||||
test/goldens/
|
||||
example/assets/
|
||||
example/android/
|
||||
example/ios/
|
||||
example/macos/
|
||||
example/web/
|
86
CHANGELOG.md
86
CHANGELOG.md
@ -1,3 +1,89 @@
|
||||
|
||||
## [2.2.0]
|
||||
Apply the latest fixes from Lottie-Android:
|
||||
|
||||
- Overhaul text layout
|
||||
- Fix rounded corners modifying already rounded corners
|
||||
- Support box position in Document Data
|
||||
- Allow interpolating between gradients with different opacity stops
|
||||
- Add support for gradient opacity stops
|
||||
|
||||
## [2.1.0]
|
||||
- Improve the cache to ensure that there is not an empty frame each time we load an animation.
|
||||
The method `AssetLottie('anim.json').load()` returns a `SynchronousFuture` if it has been loaded previously.
|
||||
- Expose the `LottieCache` singleton.
|
||||
It allows to change the cache behaviour and clear the entries.
|
||||
|
||||
```dart
|
||||
void main() {
|
||||
Lottie.cache.maximumSize = 10;
|
||||
Lottie.cache.clear();
|
||||
Lottie.cache.evict(NetworkLottie('https://lottie.com/anim.json'));
|
||||
}
|
||||
```
|
||||
|
||||
## [2.0.0]
|
||||
- **Breaking change**: the lottie widget will be smaller if it relies on the intrinsic size of the composition.
|
||||
|
||||
Previously the lottie parser was automatically multiplying the size of the composition by `window.devicePixelRatio`.
|
||||
This was incorrect as it results in a widget of a different size depending on the pixel ratio of the monitor.
|
||||
Furthermore, it created some bugs when the property `window.devicePixelRatio` was not available immediately at the start
|
||||
of the app (on Android release builds).
|
||||
|
||||
The code can be adapted to specify explicitly the size of the animation with `width`, `height` and `fit` properties.
|
||||
|
||||
```dart
|
||||
Scaffold(
|
||||
body: Center(
|
||||
child: Lottie.asset(
|
||||
'assets/LottieLogo1.json',
|
||||
height: 800,
|
||||
fit: BoxFit.contain,
|
||||
),
|
||||
),
|
||||
);
|
||||
```
|
||||
|
||||
## [1.4.3]
|
||||
- Fixed some lints with Flutter 3.3.
|
||||
|
||||
## [1.4.2]
|
||||
- Use `FilterQuality.low` as default to draw image layers.
|
||||
|
||||
## [1.4.1]
|
||||
- Allow `AlignmentGeometry` for `alignment`.
|
||||
|
||||
## [1.4.0]
|
||||
- Added `filterQuality` property to control the performance vs quality trade-off to use when drawing images
|
||||
|
||||
## [1.3.0]
|
||||
- Added support for rounded corners on shapes and rects
|
||||
- Add support for text in dynamic properties (`ValueDelegate`)
|
||||
|
||||
Example:
|
||||
|
||||
```dart
|
||||
Lottie.asset(
|
||||
'assets/DynamicText.json',
|
||||
delegates: LottieDelegates(values: [
|
||||
ValueDelegate.text(
|
||||
['Text layer'], // The path to the text element to change
|
||||
value: 'The new text',
|
||||
),
|
||||
]),
|
||||
)
|
||||
```
|
||||
|
||||
- Improve stroke with offset
|
||||
- Add support for reversed polystar paths
|
||||
- Enforce order of operations to avoid rounding errors
|
||||
|
||||
## [1.2.2]
|
||||
- Internal maintenance: fix lints for Flutter 2.10
|
||||
|
||||
## [1.2.1]
|
||||
- Fix: Revert Cubic to `PathInterpolator.cubic`
|
||||
|
||||
## [1.2.0]
|
||||
- Add support for gaussian blurs.
|
||||
|
||||
|
12
README.md
12
README.md
@ -23,7 +23,7 @@ import 'package:lottie/lottie.dart';
|
||||
void main() => runApp(const MyApp());
|
||||
|
||||
class MyApp extends StatelessWidget {
|
||||
const MyApp({Key? key}) : super(key: key);
|
||||
const MyApp({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@ -61,10 +61,10 @@ import 'package:lottie/lottie.dart';
|
||||
void main() => runApp(const MyApp());
|
||||
|
||||
class MyApp extends StatefulWidget {
|
||||
const MyApp({Key? key}) : super(key: key);
|
||||
const MyApp({super.key});
|
||||
|
||||
@override
|
||||
_MyAppState createState() => _MyAppState();
|
||||
State<MyApp> createState() => _MyAppState();
|
||||
}
|
||||
|
||||
class _MyAppState extends State<MyApp> with TickerProviderStateMixin {
|
||||
@ -136,10 +136,10 @@ This example shows how to load and parse a Lottie composition from a json file.
|
||||
|
||||
```dart
|
||||
class MyWidget extends StatefulWidget {
|
||||
const MyWidget({Key? key}) : super(key: key);
|
||||
const MyWidget({super.key});
|
||||
|
||||
@override
|
||||
_MyWidgetState createState() => _MyWidgetState();
|
||||
State<MyWidget> createState() => _MyWidgetState();
|
||||
}
|
||||
|
||||
class _MyWidgetState extends State<MyWidget> {
|
||||
@ -182,7 +182,7 @@ a specific position and size.
|
||||
class CustomDrawer extends StatelessWidget {
|
||||
final LottieComposition composition;
|
||||
|
||||
const CustomDrawer(this.composition, {Key? key}) : super(key: key);
|
||||
const CustomDrawer(this.composition, {super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
@ -10,14 +10,17 @@ linter:
|
||||
always_declare_return_types: true
|
||||
avoid_dynamic_calls: true
|
||||
avoid_escaping_inner_quotes: true
|
||||
avoid_final_parameters: true
|
||||
avoid_returning_null_for_future: true
|
||||
avoid_setters_without_getters: true
|
||||
cancel_subscriptions: true
|
||||
cast_nullable_to_non_nullable: true
|
||||
close_sinks: true
|
||||
no_adjacent_strings_in_list: true
|
||||
no_default_cases: true
|
||||
omit_local_variable_types: true
|
||||
only_throw_errors: true
|
||||
prefer_interpolation_to_compose_strings: true
|
||||
prefer_relative_imports: true
|
||||
prefer_single_quotes: true
|
||||
sort_child_properties_last: true
|
||||
sort_pub_dependencies: true
|
||||
@ -27,3 +30,4 @@ linter:
|
||||
unnecessary_statements: true
|
||||
unsafe_html: true
|
||||
use_raw_strings: true
|
||||
use_super_parameters: true
|
||||
|
@ -9,7 +9,7 @@ import 'package:lottie/lottie.dart';
|
||||
void main() => runApp(const MyApp());
|
||||
|
||||
class MyApp extends StatelessWidget {
|
||||
const MyApp({Key? key}) : super(key: key);
|
||||
const MyApp({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
6
example/android/.gitignore
vendored
6
example/android/.gitignore
vendored
@ -5,3 +5,9 @@ gradle-wrapper.jar
|
||||
/gradlew.bat
|
||||
/local.properties
|
||||
GeneratedPluginRegistrant.java
|
||||
|
||||
# Remember to never publicly share your keystore.
|
||||
# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app
|
||||
key.properties
|
||||
**/*.keystore
|
||||
**/*.jks
|
||||
|
@ -8,7 +8,7 @@ if (localPropertiesFile.exists()) {
|
||||
|
||||
def flutterRoot = localProperties.getProperty('flutter.sdk')
|
||||
if (flutterRoot == null) {
|
||||
throw new Exception("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
|
||||
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
|
||||
}
|
||||
|
||||
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
|
||||
@ -26,23 +26,28 @@ apply plugin: 'kotlin-android'
|
||||
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
|
||||
|
||||
android {
|
||||
compileSdkVersion 28
|
||||
compileSdkVersion flutter.compileSdkVersion
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_1_8
|
||||
targetCompatibility JavaVersion.VERSION_1_8
|
||||
}
|
||||
|
||||
kotlinOptions {
|
||||
jvmTarget = '1.8'
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
main.java.srcDirs += 'src/main/kotlin'
|
||||
}
|
||||
|
||||
lintOptions {
|
||||
disable 'InvalidPackage'
|
||||
}
|
||||
|
||||
defaultConfig {
|
||||
applicationId "com.github.xvrh.lottie.sample"
|
||||
minSdkVersion 16
|
||||
targetSdkVersion 28
|
||||
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
|
||||
applicationId "com.github.xvrh.lottie.example"
|
||||
minSdkVersion flutter.minSdkVersion
|
||||
targetSdkVersion flutter.targetSdkVersion
|
||||
versionCode flutterVersionCode.toInteger()
|
||||
versionName flutterVersionName
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
@ -60,7 +65,4 @@ flutter {
|
||||
|
||||
dependencies {
|
||||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
||||
testImplementation 'junit:junit:4.12'
|
||||
androidTestImplementation 'androidx.test:runner:1.1.1'
|
||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.github.xvrh.lottie.sample">
|
||||
package="com.github.xvrh.lottie.example">
|
||||
<!-- Flutter needs it to communicate with the running application
|
||||
to allow setting breakpoints, to provide hot reload, etc.
|
||||
-->
|
||||
|
@ -1,21 +1,25 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.github.xvrh.lottie.sample">
|
||||
<!-- io.flutter.app.FlutterApplication is an android.app.Application that
|
||||
calls FlutterMain.startInitialization(this); in its onCreate method.
|
||||
In most cases you can leave this as-is, but you if you want to provide
|
||||
additional functionality it is fine to subclass or reimplement
|
||||
FlutterApplication and put your custom class here. -->
|
||||
<application
|
||||
android:name="io.flutter.app.FlutterApplication"
|
||||
package="com.github.xvrh.lottie.example">
|
||||
<application
|
||||
android:label="example"
|
||||
android:name="${applicationName}"
|
||||
android:icon="@mipmap/ic_launcher">
|
||||
<activity
|
||||
android:name=".MainActivity"
|
||||
android:exported="true"
|
||||
android:launchMode="singleTop"
|
||||
android:theme="@style/LaunchTheme"
|
||||
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
|
||||
android:hardwareAccelerated="true"
|
||||
android:windowSoftInputMode="adjustResize">
|
||||
<!-- Specifies an Android theme to apply to this Activity as soon as
|
||||
the Android process has started. This theme is visible to the user
|
||||
while the Flutter UI initializes. After that, this theme continues
|
||||
to determine the Window background behind the Flutter UI. -->
|
||||
<meta-data
|
||||
android:name="io.flutter.embedding.android.NormalTheme"
|
||||
android:resource="@style/NormalTheme"
|
||||
/>
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN"/>
|
||||
<category android:name="android.intent.category.LAUNCHER"/>
|
||||
|
@ -0,0 +1,6 @@
|
||||
package com.github.xvrh.lottie.example
|
||||
|
||||
import io.flutter.embedding.android.FlutterActivity
|
||||
|
||||
class MainActivity: FlutterActivity() {
|
||||
}
|
@ -1,12 +0,0 @@
|
||||
package com.github.xvrh.lottie.sample
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import io.flutter.embedding.android.FlutterActivity
|
||||
import io.flutter.embedding.engine.FlutterEngine
|
||||
import io.flutter.plugins.GeneratedPluginRegistrant
|
||||
|
||||
class MainActivity: FlutterActivity() {
|
||||
override fun configureFlutterEngine(@NonNull flutterEngine: FlutterEngine) {
|
||||
GeneratedPluginRegistrant.registerWith(flutterEngine);
|
||||
}
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Modify this file to customize your launch splash screen -->
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:drawable="?android:colorBackground" />
|
||||
|
||||
<!-- You can insert your own image assets here -->
|
||||
<!-- <item>
|
||||
<bitmap
|
||||
android:gravity="center"
|
||||
android:src="@mipmap/launch_image" />
|
||||
</item> -->
|
||||
</layer-list>
|
18
example/android/app/src/main/res/values-night/styles.xml
Normal file
18
example/android/app/src/main/res/values-night/styles.xml
Normal file
@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is on -->
|
||||
<style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar">
|
||||
<!-- Show a splash screen on the activity. Automatically removed when
|
||||
Flutter draws its first frame -->
|
||||
<item name="android:windowBackground">@drawable/launch_background</item>
|
||||
</style>
|
||||
<!-- Theme applied to the Android Window as soon as the process has started.
|
||||
This theme determines the color of the Android Window while your
|
||||
Flutter UI initializes, as well as behind your Flutter UI while its
|
||||
running.
|
||||
|
||||
This Theme is only used starting with V2 of Flutter's Android embedding. -->
|
||||
<style name="NormalTheme" parent="@android:style/Theme.Black.NoTitleBar">
|
||||
<item name="android:windowBackground">?android:colorBackground</item>
|
||||
</style>
|
||||
</resources>
|
@ -1,8 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar">
|
||||
<!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is off -->
|
||||
<style name="LaunchTheme" parent="@android:style/Theme.Light.NoTitleBar">
|
||||
<!-- Show a splash screen on the activity. Automatically removed when
|
||||
Flutter draws its first frame -->
|
||||
<item name="android:windowBackground">@drawable/launch_background</item>
|
||||
</style>
|
||||
<!-- Theme applied to the Android Window as soon as the process has started.
|
||||
This theme determines the color of the Android Window while your
|
||||
Flutter UI initializes, as well as behind your Flutter UI while its
|
||||
running.
|
||||
|
||||
This Theme is only used starting with V2 of Flutter's Android embedding. -->
|
||||
<style name="NormalTheme" parent="@android:style/Theme.Light.NoTitleBar">
|
||||
<item name="android:windowBackground">?android:colorBackground</item>
|
||||
</style>
|
||||
</resources>
|
||||
|
@ -1,5 +1,5 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.github.xvrh.lottie.sample">
|
||||
package="com.github.xvrh.lottie.example">
|
||||
<!-- Flutter needs it to communicate with the running application
|
||||
to allow setting breakpoints, to provide hot reload, etc.
|
||||
-->
|
||||
|
@ -1,12 +1,12 @@
|
||||
buildscript {
|
||||
ext.kotlin_version = '1.3.50'
|
||||
ext.kotlin_version = '1.6.10'
|
||||
repositories {
|
||||
google()
|
||||
jcenter()
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:3.5.0'
|
||||
classpath 'com.android.tools.build:gradle:4.1.0'
|
||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||
}
|
||||
}
|
||||
@ -14,7 +14,7 @@ buildscript {
|
||||
allprojects {
|
||||
repositories {
|
||||
google()
|
||||
jcenter()
|
||||
mavenCentral()
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,3 @@
|
||||
org.gradle.jvmargs=-Xmx1536M
|
||||
android.enableR8=true
|
||||
android.useAndroidX=true
|
||||
android.enableJetifier=true
|
||||
|
@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip
|
||||
|
@ -1,15 +1,11 @@
|
||||
include ':app'
|
||||
|
||||
def flutterProjectRoot = rootProject.projectDir.parentFile.toPath()
|
||||
def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
|
||||
def properties = new Properties()
|
||||
|
||||
def plugins = new Properties()
|
||||
def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins')
|
||||
if (pluginsFile.exists()) {
|
||||
pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) }
|
||||
}
|
||||
assert localPropertiesFile.exists()
|
||||
localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
|
||||
|
||||
plugins.each { name, path ->
|
||||
def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile()
|
||||
include ":$name"
|
||||
project(":$name").projectDir = pluginDirectory
|
||||
}
|
||||
def flutterSdkPath = properties.getProperty("flutter.sdk")
|
||||
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
|
||||
apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
|
||||
|
1
example/assets/Tests/BeyondBounds.json
Normal file
1
example/assets/Tests/BeyondBounds.json
Normal file
@ -0,0 +1 @@
|
||||
{"v":"5.8.2","fr":23.9759979248047,"ip":0,"op":71.9999937681822,"w":400,"h":400,"nm":"BeyondBounds","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Shape Layer 1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[200,200,0],"ix":2,"l":2},"a":{"a":0,"k":[0,0,0],"ix":1,"l":2},"s":{"a":0,"k":[100,100,100],"ix":6,"l":2}},"ao":0,"shapes":[{"ty":"gr","it":[{"d":1,"ty":"el","s":{"a":0,"k":[510.547,510.547],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"nm":"Ellipse Path 1","mn":"ADBE Vector Shape - Ellipse","hd":false},{"ty":"fl","c":{"a":0,"k":[1,0,0,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Ellipse 1","np":2,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":71.9999937681822,"st":0,"bm":0}],"markers":[]}
|
BIN
example/assets/Tests/EmbeddedFont.zip
Normal file
BIN
example/assets/Tests/EmbeddedFont.zip
Normal file
Binary file not shown.
1
example/assets/Tests/Framerate.json
Normal file
1
example/assets/Tests/Framerate.json
Normal file
@ -0,0 +1 @@
|
||||
{"v":"5.9.6","fr":3,"ip":0,"op":3,"w":200,"h":200,"nm":"Comp 1","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Shape Layer 1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":1,"k":[{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":0,"s":[30,30,0],"to":[21.667,21.667,0],"ti":[-21.667,-21.667,0]},{"t":2,"s":[160,160,0]}],"ix":2,"l":2},"a":{"a":0,"k":[0,0,0],"ix":1,"l":2},"s":{"a":0,"k":[100,100,100],"ix":6,"l":2}},"ao":0,"shapes":[{"ty":"gr","it":[{"ty":"rc","d":1,"s":{"a":0,"k":[58.742,58.742],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"r":{"a":0,"k":0,"ix":4},"nm":"Rectangle Path 1","mn":"ADBE Vector Shape - Rect","hd":false},{"ty":"fl","c":{"a":0,"k":[1,0,0,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Rectangle 1","np":2,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":3,"st":0,"ct":1,"bm":0}],"markers":[]}
|
3512
example/assets/Tests/GradientOneColor.json
Normal file
3512
example/assets/Tests/GradientOneColor.json
Normal file
File diff suppressed because it is too large
Load Diff
1
example/assets/Tests/Heart.json
Normal file
1
example/assets/Tests/Heart.json
Normal file
File diff suppressed because one or more lines are too long
1038
example/assets/Tests/InterpolateBetweenOpacityStops.json
Executable file
1038
example/assets/Tests/InterpolateBetweenOpacityStops.json
Executable file
File diff suppressed because it is too large
Load Diff
1
example/assets/Tests/LargeComposition.json
Normal file
1
example/assets/Tests/LargeComposition.json
Normal file
@ -0,0 +1 @@
|
||||
{"v":"5.8.1","fr":25,"ip":0,"op":2,"w":2000,"h":4000,"nm":"Comp 1","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Shape Layer 1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[1000,2000,0],"ix":2,"l":2},"a":{"a":0,"k":[0,0,0],"ix":1,"l":2},"s":{"a":0,"k":[100,100,100],"ix":6,"l":2}},"ao":0,"shapes":[{"ty":"gr","it":[{"ty":"rc","d":1,"s":{"a":0,"k":[1554.562,597.062],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"r":{"a":0,"k":0,"ix":4},"nm":"Rectangle Path 1","mn":"ADBE Vector Shape - Rect","hd":false},{"ty":"fl","c":{"a":0,"k":[0.220496237278,1,0,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[1.281,-21.469],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Rectangle 2","np":2,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false},{"ty":"gr","it":[{"ty":"rc","d":1,"s":{"a":0,"k":[1780.188,3801.75],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"r":{"a":0,"k":0,"ix":4},"nm":"Rectangle Path 1","mn":"ADBE Vector Shape - Rect","hd":false},{"ty":"fl","c":{"a":0,"k":[0,0.116727701823,1,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[2.094,12.875],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Rectangle 1","np":2,"cix":2,"bm":0,"ix":2,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":2,"st":0,"bm":0},{"ddd":0,"ind":2,"ty":1,"nm":"Red Solid 1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[1000,2000,0],"ix":2,"l":2},"a":{"a":0,"k":[1000,2000,0],"ix":1,"l":2},"s":{"a":0,"k":[100,100,100],"ix":6,"l":2}},"ao":0,"sw":2000,"sh":4000,"sc":"#ff0000","ip":0,"op":2,"st":0,"bm":0}],"markers":[]}
|
1
example/assets/Tests/Multiline.json
Normal file
1
example/assets/Tests/Multiline.json
Normal file
File diff suppressed because one or more lines are too long
494
example/assets/Tests/OpacityStops.json
Normal file
494
example/assets/Tests/OpacityStops.json
Normal file
@ -0,0 +1,494 @@
|
||||
{
|
||||
"tgs": 1,
|
||||
"v": "5.5.2",
|
||||
"fr": 60,
|
||||
"ip": 0,
|
||||
"op": 180,
|
||||
"w": 512,
|
||||
"h": 512,
|
||||
"nm": "02_ricl_klass - 3:00",
|
||||
"ddd": 0,
|
||||
"assets": [],
|
||||
"layers": [
|
||||
{
|
||||
"ddd": 0,
|
||||
"ind": 6,
|
||||
"ty": 4,
|
||||
"parent": 5,
|
||||
"sr": 1,
|
||||
"ks": {
|
||||
"o": {
|
||||
"a": 1,
|
||||
"k": [
|
||||
{
|
||||
"i": {
|
||||
"x": [
|
||||
0.833
|
||||
],
|
||||
"y": [
|
||||
0.833
|
||||
]
|
||||
},
|
||||
"o": {
|
||||
"x": [
|
||||
0.167
|
||||
],
|
||||
"y": [
|
||||
0.167
|
||||
]
|
||||
},
|
||||
"t": -105,
|
||||
"s": [
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"i": {
|
||||
"x": [
|
||||
0.833
|
||||
],
|
||||
"y": [
|
||||
0.833
|
||||
]
|
||||
},
|
||||
"o": {
|
||||
"x": [
|
||||
0.167
|
||||
],
|
||||
"y": [
|
||||
0.167
|
||||
]
|
||||
},
|
||||
"t": -104,
|
||||
"s": [
|
||||
100
|
||||
]
|
||||
},
|
||||
{
|
||||
"i": {
|
||||
"x": [
|
||||
0.833
|
||||
],
|
||||
"y": [
|
||||
0.833
|
||||
]
|
||||
},
|
||||
"o": {
|
||||
"x": [
|
||||
0.167
|
||||
],
|
||||
"y": [
|
||||
0.167
|
||||
]
|
||||
},
|
||||
"t": 34,
|
||||
"s": [
|
||||
100
|
||||
]
|
||||
},
|
||||
{
|
||||
"i": {
|
||||
"x": [
|
||||
0.833
|
||||
],
|
||||
"y": [
|
||||
0.833
|
||||
]
|
||||
},
|
||||
"o": {
|
||||
"x": [
|
||||
0.167
|
||||
],
|
||||
"y": [
|
||||
0.167
|
||||
]
|
||||
},
|
||||
"t": 35,
|
||||
"s": [
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"i": {
|
||||
"x": [
|
||||
0.833
|
||||
],
|
||||
"y": [
|
||||
0.833
|
||||
]
|
||||
},
|
||||
"o": {
|
||||
"x": [
|
||||
0.167
|
||||
],
|
||||
"y": [
|
||||
0.167
|
||||
]
|
||||
},
|
||||
"t": 75,
|
||||
"s": [
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"i": {
|
||||
"x": [
|
||||
0.833
|
||||
],
|
||||
"y": [
|
||||
0.833
|
||||
]
|
||||
},
|
||||
"o": {
|
||||
"x": [
|
||||
0.167
|
||||
],
|
||||
"y": [
|
||||
0.167
|
||||
]
|
||||
},
|
||||
"t": 76,
|
||||
"s": [
|
||||
100
|
||||
]
|
||||
},
|
||||
{
|
||||
"i": {
|
||||
"x": [
|
||||
0.833
|
||||
],
|
||||
"y": [
|
||||
0.833
|
||||
]
|
||||
},
|
||||
"o": {
|
||||
"x": [
|
||||
0.167
|
||||
],
|
||||
"y": [
|
||||
0.167
|
||||
]
|
||||
},
|
||||
"t": 214,
|
||||
"s": [
|
||||
100
|
||||
]
|
||||
},
|
||||
{
|
||||
"t": 215,
|
||||
"s": [
|
||||
0
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"p": {
|
||||
"a": 0,
|
||||
"k": [
|
||||
0,
|
||||
-0.031,
|
||||
0
|
||||
]
|
||||
},
|
||||
"a": {
|
||||
"a": 0,
|
||||
"k": [
|
||||
-87,
|
||||
-18.182,
|
||||
0
|
||||
]
|
||||
},
|
||||
"s": {
|
||||
"a": 0,
|
||||
"k": [
|
||||
50,
|
||||
33,
|
||||
100
|
||||
]
|
||||
}
|
||||
},
|
||||
"ao": 0,
|
||||
"shapes": [
|
||||
{
|
||||
"ty": "gr",
|
||||
"it": [
|
||||
{
|
||||
"ind": 0,
|
||||
"ty": "sh",
|
||||
"ks": {
|
||||
"a": 1,
|
||||
"k": [
|
||||
{
|
||||
"i": {
|
||||
"x": 0.833,
|
||||
"y": 0.833
|
||||
},
|
||||
"o": {
|
||||
"x": 0.167,
|
||||
"y": 0.167
|
||||
},
|
||||
"t": 213,
|
||||
"s": [
|
||||
{
|
||||
"i": [
|
||||
[
|
||||
0,
|
||||
0
|
||||
],
|
||||
[
|
||||
0,
|
||||
0
|
||||
],
|
||||
[
|
||||
0,
|
||||
0
|
||||
],
|
||||
[
|
||||
0,
|
||||
0
|
||||
]
|
||||
],
|
||||
"o": [
|
||||
[
|
||||
0,
|
||||
0
|
||||
],
|
||||
[
|
||||
0,
|
||||
0
|
||||
],
|
||||
[
|
||||
0,
|
||||
0
|
||||
],
|
||||
[
|
||||
0,
|
||||
0
|
||||
]
|
||||
],
|
||||
"v": [
|
||||
[
|
||||
571.25,
|
||||
-298.22
|
||||
],
|
||||
[
|
||||
-192.5,
|
||||
-267.902
|
||||
],
|
||||
[
|
||||
-182.875,
|
||||
510.152
|
||||
],
|
||||
[
|
||||
575.125,
|
||||
547.848
|
||||
]
|
||||
],
|
||||
"c": true
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"t": 214,
|
||||
"s": [
|
||||
{
|
||||
"i": [
|
||||
[
|
||||
0,
|
||||
0
|
||||
],
|
||||
[
|
||||
0,
|
||||
0
|
||||
],
|
||||
[
|
||||
0,
|
||||
0
|
||||
],
|
||||
[
|
||||
0,
|
||||
0
|
||||
]
|
||||
],
|
||||
"o": [
|
||||
[
|
||||
0,
|
||||
0
|
||||
],
|
||||
[
|
||||
0,
|
||||
0
|
||||
],
|
||||
[
|
||||
0,
|
||||
0
|
||||
],
|
||||
[
|
||||
0,
|
||||
0
|
||||
]
|
||||
],
|
||||
"v": [
|
||||
[
|
||||
122.25,
|
||||
-242.159
|
||||
],
|
||||
[
|
||||
-192.5,
|
||||
-267.902
|
||||
],
|
||||
[
|
||||
-181.875,
|
||||
178.333
|
||||
],
|
||||
[
|
||||
175.125,
|
||||
141.788
|
||||
]
|
||||
],
|
||||
"c": true
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"hd": false
|
||||
},
|
||||
{
|
||||
"ty": "gf",
|
||||
"o": {
|
||||
"a": 0,
|
||||
"k": 100
|
||||
},
|
||||
"r": 1,
|
||||
"bm": 0,
|
||||
"g": {
|
||||
"p": 5,
|
||||
"k": {
|
||||
"a": 0,
|
||||
"k": [
|
||||
0.832,
|
||||
0.275,
|
||||
0.89,
|
||||
0.086,
|
||||
|
||||
0.86,
|
||||
0.275,
|
||||
0.89,
|
||||
0.086,
|
||||
|
||||
0.887,
|
||||
0.275,
|
||||
0.89,
|
||||
0.086,
|
||||
|
||||
0.944,
|
||||
0.275,
|
||||
0.89,
|
||||
0.086,
|
||||
|
||||
1,
|
||||
0.275,
|
||||
0.89,
|
||||
0.086,
|
||||
|
||||
0.65,
|
||||
0,
|
||||
|
||||
0.785,
|
||||
0.5,
|
||||
|
||||
0.84,
|
||||
1,
|
||||
|
||||
0.862,
|
||||
1,
|
||||
|
||||
0.885,
|
||||
1,
|
||||
|
||||
0.896,
|
||||
0.5,
|
||||
|
||||
0.908,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"s": {
|
||||
"a": 0,
|
||||
"k": [
|
||||
457.898,
|
||||
-71.143
|
||||
]
|
||||
},
|
||||
"e": {
|
||||
"a": 0,
|
||||
"k": [
|
||||
-182.411,
|
||||
-47.941
|
||||
]
|
||||
},
|
||||
"t": 2,
|
||||
"h": {
|
||||
"a": 0,
|
||||
"k": 0
|
||||
},
|
||||
"a": {
|
||||
"a": 0,
|
||||
"k": 97.679
|
||||
},
|
||||
"hd": false
|
||||
},
|
||||
{
|
||||
"ty": "tr",
|
||||
"p": {
|
||||
"a": 0,
|
||||
"k": [
|
||||
0,
|
||||
0
|
||||
]
|
||||
},
|
||||
"a": {
|
||||
"a": 0,
|
||||
"k": [
|
||||
0,
|
||||
0
|
||||
]
|
||||
},
|
||||
"s": {
|
||||
"a": 0,
|
||||
"k": [
|
||||
100,
|
||||
100
|
||||
]
|
||||
},
|
||||
"r": {
|
||||
"a": 0,
|
||||
"k": 0
|
||||
},
|
||||
"o": {
|
||||
"a": 0,
|
||||
"k": 100
|
||||
},
|
||||
"sk": {
|
||||
"a": 0,
|
||||
"k": 0
|
||||
},
|
||||
"sa": {
|
||||
"a": 0,
|
||||
"k": 0
|
||||
}
|
||||
}
|
||||
],
|
||||
"bm": 0,
|
||||
"hd": false
|
||||
}
|
||||
],
|
||||
"ip": 0,
|
||||
"op": 180,
|
||||
"st": -120,
|
||||
"bm": 0
|
||||
}
|
||||
]
|
||||
}
|
1
example/assets/Tests/PrecompBlurDecimapPrecompSize.json
Normal file
1
example/assets/Tests/PrecompBlurDecimapPrecompSize.json
Normal file
File diff suppressed because one or more lines are too long
288
example/assets/Tests/ReversedStar.json
Normal file
288
example/assets/Tests/ReversedStar.json
Normal file
@ -0,0 +1,288 @@
|
||||
{
|
||||
"v": "5.8.2",
|
||||
"fr": 24,
|
||||
"ip": 0,
|
||||
"op": 94,
|
||||
"w": 150,
|
||||
"h": 150,
|
||||
"nm": "Anim_load",
|
||||
"ddd": 0,
|
||||
"assets": [],
|
||||
"layers": [
|
||||
{
|
||||
"ddd": 0,
|
||||
"ind": 1,
|
||||
"ty": 4,
|
||||
"nm": "LF03",
|
||||
"sr": 1,
|
||||
"ks": {
|
||||
"o": {
|
||||
"a": 0,
|
||||
"k": 100,
|
||||
"ix": 11
|
||||
},
|
||||
"r": {
|
||||
"a": 0,
|
||||
"k": -19,
|
||||
"ix": 10
|
||||
},
|
||||
"p": {
|
||||
"a": 0,
|
||||
"k": [
|
||||
75,
|
||||
76.005,
|
||||
0
|
||||
],
|
||||
"ix": 2,
|
||||
"l": 2
|
||||
},
|
||||
"a": {
|
||||
"a": 0,
|
||||
"k": [
|
||||
0,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"ix": 1,
|
||||
"l": 2
|
||||
},
|
||||
"s": {
|
||||
"a": 0,
|
||||
"k": [
|
||||
19.986,
|
||||
19.986,
|
||||
100
|
||||
],
|
||||
"ix": 6,
|
||||
"l": 2
|
||||
}
|
||||
},
|
||||
"ao": 0,
|
||||
"shapes": [
|
||||
{
|
||||
"ty": "gr",
|
||||
"it": [
|
||||
{
|
||||
"ty": "sr",
|
||||
"sy": 1,
|
||||
"d": 3,
|
||||
"pt": {
|
||||
"a": 0,
|
||||
"k": 14,
|
||||
"ix": 3
|
||||
},
|
||||
"p": {
|
||||
"a": 0,
|
||||
"k": [
|
||||
0,
|
||||
0
|
||||
],
|
||||
"ix": 4
|
||||
},
|
||||
"r": {
|
||||
"a": 0,
|
||||
"k": 0,
|
||||
"ix": 5
|
||||
},
|
||||
"ir": {
|
||||
"a": 0,
|
||||
"k": 91.612,
|
||||
"ix": 6
|
||||
},
|
||||
"is": {
|
||||
"a": 0,
|
||||
"k": 0,
|
||||
"ix": 8
|
||||
},
|
||||
"or": {
|
||||
"a": 0,
|
||||
"k": 113.225,
|
||||
"ix": 7
|
||||
},
|
||||
"os": {
|
||||
"a": 0,
|
||||
"k": 0,
|
||||
"ix": 9
|
||||
},
|
||||
"ix": 1,
|
||||
"nm": "Polystar Path 1",
|
||||
"mn": "ADBE Vector Shape - Star",
|
||||
"hd": false
|
||||
},
|
||||
{
|
||||
"ty": "st",
|
||||
"c": {
|
||||
"a": 0,
|
||||
"k": [
|
||||
0.937254905701,
|
||||
0.89411765337,
|
||||
0.850980401039,
|
||||
1
|
||||
],
|
||||
"ix": 3
|
||||
},
|
||||
"o": {
|
||||
"a": 0,
|
||||
"k": 100,
|
||||
"ix": 4
|
||||
},
|
||||
"w": {
|
||||
"a": 0,
|
||||
"k": 30,
|
||||
"ix": 5
|
||||
},
|
||||
"lc": 1,
|
||||
"lj": 1,
|
||||
"ml": 4,
|
||||
"bm": 0,
|
||||
"nm": "Stroke 1",
|
||||
"mn": "ADBE Vector Graphic - Stroke",
|
||||
"hd": false
|
||||
},
|
||||
{
|
||||
"ty": "tr",
|
||||
"p": {
|
||||
"a": 0,
|
||||
"k": [
|
||||
-1.979,
|
||||
-0.604
|
||||
],
|
||||
"ix": 2
|
||||
},
|
||||
"a": {
|
||||
"a": 0,
|
||||
"k": [
|
||||
0,
|
||||
0
|
||||
],
|
||||
"ix": 1
|
||||
},
|
||||
"s": {
|
||||
"a": 0,
|
||||
"k": [
|
||||
100,
|
||||
100
|
||||
],
|
||||
"ix": 3
|
||||
},
|
||||
"r": {
|
||||
"a": 0,
|
||||
"k": 0,
|
||||
"ix": 6
|
||||
},
|
||||
"o": {
|
||||
"a": 0,
|
||||
"k": 100,
|
||||
"ix": 7
|
||||
},
|
||||
"sk": {
|
||||
"a": 0,
|
||||
"k": 0,
|
||||
"ix": 4
|
||||
},
|
||||
"sa": {
|
||||
"a": 0,
|
||||
"k": 0,
|
||||
"ix": 5
|
||||
},
|
||||
"nm": "Transform"
|
||||
}
|
||||
],
|
||||
"nm": "Polystar 1",
|
||||
"np": 2,
|
||||
"cix": 2,
|
||||
"bm": 0,
|
||||
"ix": 1,
|
||||
"mn": "ADBE Vector Group",
|
||||
"hd": false
|
||||
},
|
||||
{
|
||||
"ty": "tm",
|
||||
"s": {
|
||||
"a": 1,
|
||||
"k": [
|
||||
{
|
||||
"i": {
|
||||
"x": [
|
||||
0.667
|
||||
],
|
||||
"y": [
|
||||
1
|
||||
]
|
||||
},
|
||||
"o": {
|
||||
"x": [
|
||||
0.333
|
||||
],
|
||||
"y": [
|
||||
0
|
||||
]
|
||||
},
|
||||
"t": -0.127,
|
||||
"s": [
|
||||
100
|
||||
]
|
||||
},
|
||||
{
|
||||
"t": 32,
|
||||
"s": [
|
||||
0
|
||||
]
|
||||
}
|
||||
],
|
||||
"ix": 1
|
||||
},
|
||||
"e": {
|
||||
"a": 1,
|
||||
"k": [
|
||||
{
|
||||
"i": {
|
||||
"x": [
|
||||
0.833
|
||||
],
|
||||
"y": [
|
||||
1
|
||||
]
|
||||
},
|
||||
"o": {
|
||||
"x": [
|
||||
0.333
|
||||
],
|
||||
"y": [
|
||||
0
|
||||
]
|
||||
},
|
||||
"t": 36,
|
||||
"s": [
|
||||
100
|
||||
]
|
||||
},
|
||||
{
|
||||
"t": 68,
|
||||
"s": [
|
||||
0
|
||||
]
|
||||
}
|
||||
],
|
||||
"ix": 2
|
||||
},
|
||||
"o": {
|
||||
"a": 0,
|
||||
"k": -43,
|
||||
"ix": 3
|
||||
},
|
||||
"m": 1,
|
||||
"ix": 2,
|
||||
"nm": "Trim Paths 1",
|
||||
"mn": "ADBE Vector Filter - Trim",
|
||||
"hd": false
|
||||
}
|
||||
],
|
||||
"ip": 0,
|
||||
"op": 94,
|
||||
"st": 18,
|
||||
"bm": 0
|
||||
}
|
||||
],
|
||||
"markers": []
|
||||
}
|
390
example/assets/Tests/RoundedCorners.json
Normal file
390
example/assets/Tests/RoundedCorners.json
Normal file
@ -0,0 +1,390 @@
|
||||
{
|
||||
"v": "5.8.1",
|
||||
"fr": 29.9700012207031,
|
||||
"ip": 0,
|
||||
"op": 900.000036657751,
|
||||
"w": 1000,
|
||||
"h": 1000,
|
||||
"nm": "Rounded Corners",
|
||||
"ddd": 0,
|
||||
"assets": [],
|
||||
"layers": [
|
||||
{
|
||||
"ddd": 0,
|
||||
"ind": 1,
|
||||
"ty": 4,
|
||||
"nm": "Shape Layer 1",
|
||||
"sr": 1,
|
||||
"ks": {
|
||||
"o": {
|
||||
"a": 0,
|
||||
"k": 100,
|
||||
"ix": 11
|
||||
},
|
||||
"r": {
|
||||
"a": 0,
|
||||
"k": 0,
|
||||
"ix": 10
|
||||
},
|
||||
"p": {
|
||||
"a": 0,
|
||||
"k": [
|
||||
500,
|
||||
500,
|
||||
0
|
||||
],
|
||||
"ix": 2,
|
||||
"l": 2
|
||||
},
|
||||
"a": {
|
||||
"a": 0,
|
||||
"k": [
|
||||
0,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"ix": 1,
|
||||
"l": 2
|
||||
},
|
||||
"s": {
|
||||
"a": 0,
|
||||
"k": [
|
||||
100,
|
||||
100,
|
||||
100
|
||||
],
|
||||
"ix": 6,
|
||||
"l": 2
|
||||
}
|
||||
},
|
||||
"ao": 0,
|
||||
"shapes": [
|
||||
{
|
||||
"ind": 0,
|
||||
"ty": "sh",
|
||||
"ix": 1,
|
||||
"ks": {
|
||||
"a": 0,
|
||||
"k": {
|
||||
"i": [
|
||||
[
|
||||
0,
|
||||
0
|
||||
],
|
||||
[
|
||||
0,
|
||||
0
|
||||
],
|
||||
[
|
||||
0,
|
||||
0
|
||||
],
|
||||
[
|
||||
0,
|
||||
0
|
||||
]
|
||||
],
|
||||
"o": [
|
||||
[
|
||||
0,
|
||||
0
|
||||
],
|
||||
[
|
||||
0,
|
||||
0
|
||||
],
|
||||
[
|
||||
0,
|
||||
0
|
||||
],
|
||||
[
|
||||
0,
|
||||
0
|
||||
]
|
||||
],
|
||||
"v": [
|
||||
[
|
||||
-75,
|
||||
-475
|
||||
],
|
||||
[
|
||||
-75,
|
||||
-75
|
||||
],
|
||||
[
|
||||
-475,
|
||||
-75
|
||||
],
|
||||
[
|
||||
-475,
|
||||
-475
|
||||
]
|
||||
],
|
||||
"c": true
|
||||
},
|
||||
"ix": 2
|
||||
},
|
||||
"nm": "Path 1",
|
||||
"mn": "ADBE Vector Shape - Group",
|
||||
"hd": false
|
||||
},
|
||||
{
|
||||
"ty": "rc",
|
||||
"d": 1,
|
||||
"s": {
|
||||
"a": 0,
|
||||
"k": [
|
||||
400,
|
||||
400
|
||||
],
|
||||
"ix": 2
|
||||
},
|
||||
"p": {
|
||||
"a": 0,
|
||||
"k": [
|
||||
275,
|
||||
-275
|
||||
],
|
||||
"ix": 3
|
||||
},
|
||||
"r": {
|
||||
"a": 0,
|
||||
"k": 0,
|
||||
"ix": 4
|
||||
},
|
||||
"nm": "Rectangle Path 1",
|
||||
"mn": "ADBE Vector Shape - Rect",
|
||||
"hd": false
|
||||
},
|
||||
{
|
||||
"ty": "sr",
|
||||
"sy": 1,
|
||||
"d": 1,
|
||||
"pt": {
|
||||
"a": 0,
|
||||
"k": 5,
|
||||
"ix": 3
|
||||
},
|
||||
"p": {
|
||||
"a": 0,
|
||||
"k": [
|
||||
275,
|
||||
275
|
||||
],
|
||||
"ix": 4
|
||||
},
|
||||
"r": {
|
||||
"a": 0,
|
||||
"k": 0,
|
||||
"ix": 5
|
||||
},
|
||||
"ir": {
|
||||
"a": 0,
|
||||
"k": 107,
|
||||
"ix": 6
|
||||
},
|
||||
"is": {
|
||||
"a": 0,
|
||||
"k": 0,
|
||||
"ix": 8
|
||||
},
|
||||
"or": {
|
||||
"a": 0,
|
||||
"k": 275,
|
||||
"ix": 7
|
||||
},
|
||||
"os": {
|
||||
"a": 0,
|
||||
"k": 0,
|
||||
"ix": 9
|
||||
},
|
||||
"ix": 3,
|
||||
"nm": "Polystar Path 1",
|
||||
"mn": "ADBE Vector Shape - Star",
|
||||
"hd": false
|
||||
},
|
||||
{
|
||||
"ind": 3,
|
||||
"ty": "sh",
|
||||
"ix": 4,
|
||||
"ks": {
|
||||
"a": 0,
|
||||
"k": {
|
||||
"i": [
|
||||
[
|
||||
0,
|
||||
0
|
||||
],
|
||||
[
|
||||
0,
|
||||
0
|
||||
],
|
||||
[
|
||||
0,
|
||||
0
|
||||
],
|
||||
[
|
||||
0,
|
||||
0
|
||||
],
|
||||
[
|
||||
0,
|
||||
0
|
||||
],
|
||||
[
|
||||
0,
|
||||
0
|
||||
],
|
||||
[
|
||||
0,
|
||||
0
|
||||
],
|
||||
[
|
||||
0,
|
||||
0
|
||||
],
|
||||
[
|
||||
0,
|
||||
0
|
||||
],
|
||||
[
|
||||
0,
|
||||
0
|
||||
]
|
||||
],
|
||||
"o": [
|
||||
[
|
||||
0,
|
||||
0
|
||||
],
|
||||
[
|
||||
0,
|
||||
0
|
||||
],
|
||||
[
|
||||
0,
|
||||
0
|
||||
],
|
||||
[
|
||||
0,
|
||||
0
|
||||
],
|
||||
[
|
||||
0,
|
||||
0
|
||||
],
|
||||
[
|
||||
0,
|
||||
0
|
||||
],
|
||||
[
|
||||
0,
|
||||
0
|
||||
],
|
||||
[
|
||||
0,
|
||||
0
|
||||
],
|
||||
[
|
||||
0,
|
||||
0
|
||||
],
|
||||
[
|
||||
0,
|
||||
0
|
||||
]
|
||||
],
|
||||
"v": [
|
||||
[
|
||||
-275,
|
||||
0
|
||||
],
|
||||
[
|
||||
-212.107,
|
||||
188.435
|
||||
],
|
||||
[
|
||||
-13.459,
|
||||
190.02
|
||||
],
|
||||
[
|
||||
-173.237,
|
||||
308.065
|
||||
],
|
||||
[
|
||||
-113.359,
|
||||
497.48
|
||||
],
|
||||
[
|
||||
-275,
|
||||
382
|
||||
],
|
||||
[
|
||||
-436.641,
|
||||
497.48
|
||||
],
|
||||
[
|
||||
-376.763,
|
||||
308.065
|
||||
],
|
||||
[
|
||||
-536.541,
|
||||
190.02
|
||||
],
|
||||
[
|
||||
-337.893,
|
||||
188.435
|
||||
]
|
||||
],
|
||||
"c": true
|
||||
},
|
||||
"ix": 2
|
||||
},
|
||||
"nm": "Path 2",
|
||||
"mn": "ADBE Vector Shape - Group",
|
||||
"hd": false
|
||||
},
|
||||
{
|
||||
"ty": "rd",
|
||||
"nm": "Round Corners 1",
|
||||
"r": {
|
||||
"a": 0,
|
||||
"k": 136,
|
||||
"ix": 1
|
||||
},
|
||||
"ix": 5,
|
||||
"mn": "ADBE Vector Filter - RC",
|
||||
"hd": false
|
||||
},
|
||||
{
|
||||
"ty": "fl",
|
||||
"c": {
|
||||
"a": 0,
|
||||
"k": [
|
||||
1,
|
||||
0,
|
||||
0,
|
||||
1
|
||||
],
|
||||
"ix": 4
|
||||
},
|
||||
"o": {
|
||||
"a": 0,
|
||||
"k": 100,
|
||||
"ix": 5
|
||||
},
|
||||
"r": 1,
|
||||
"bm": 0,
|
||||
"nm": "Fill 1",
|
||||
"mn": "ADBE Vector Graphic - Fill",
|
||||
"hd": false
|
||||
}
|
||||
],
|
||||
"ip": 0,
|
||||
"op": 900.000036657751,
|
||||
"st": 0,
|
||||
"bm": 0
|
||||
}
|
||||
],
|
||||
"markers": []
|
||||
}
|
386
example/assets/Tests/RoundedWithAlreadyRoundedCorners.json
Normal file
386
example/assets/Tests/RoundedWithAlreadyRoundedCorners.json
Normal file
@ -0,0 +1,386 @@
|
||||
{
|
||||
"v": "5.9.1",
|
||||
"fr": 60,
|
||||
"ip": 0,
|
||||
"op": 56,
|
||||
"w": 1080,
|
||||
"h": 1080,
|
||||
"nm": "Warning",
|
||||
"ddd": 0,
|
||||
"assets": [
|
||||
{
|
||||
"id": "comp_0",
|
||||
"nm": "Warning_2",
|
||||
"fr": 60,
|
||||
"layers": [
|
||||
{
|
||||
"ddd": 0,
|
||||
"ind": 3,
|
||||
"ty": 4,
|
||||
"nm": "CERCHIO contorni",
|
||||
"sr": 1,
|
||||
"ks": {
|
||||
"o": {
|
||||
"a": 0,
|
||||
"k": 100,
|
||||
"ix": 11
|
||||
},
|
||||
"r": {
|
||||
"a": 0,
|
||||
"k": 0,
|
||||
"ix": 10
|
||||
},
|
||||
"p": {
|
||||
"a": 0,
|
||||
"k": [
|
||||
24.5,
|
||||
24.5,
|
||||
0
|
||||
],
|
||||
"ix": 2,
|
||||
"l": 2
|
||||
},
|
||||
"a": {
|
||||
"a": 0,
|
||||
"k": [
|
||||
29.5,
|
||||
29.5,
|
||||
0
|
||||
],
|
||||
"ix": 1,
|
||||
"l": 2
|
||||
},
|
||||
"s": {
|
||||
"a": 0,
|
||||
"k": [
|
||||
100,
|
||||
100,
|
||||
100
|
||||
],
|
||||
"ix": 6,
|
||||
"l": 2
|
||||
}
|
||||
},
|
||||
"ao": 0,
|
||||
"shapes": [
|
||||
{
|
||||
"ty": "gr",
|
||||
"it": [
|
||||
{
|
||||
"ind": 0,
|
||||
"ty": "sh",
|
||||
"ix": 1,
|
||||
"ks": {
|
||||
"a": 0,
|
||||
"k": {
|
||||
"i": [
|
||||
[
|
||||
-12.15,
|
||||
0
|
||||
],
|
||||
[
|
||||
0,
|
||||
-12.15
|
||||
],
|
||||
[
|
||||
12.15,
|
||||
0
|
||||
],
|
||||
[
|
||||
0,
|
||||
12.15
|
||||
]
|
||||
],
|
||||
"o": [
|
||||
[
|
||||
12.15,
|
||||
0
|
||||
],
|
||||
[
|
||||
0,
|
||||
12.15
|
||||
],
|
||||
[
|
||||
-12.15,
|
||||
0
|
||||
],
|
||||
[
|
||||
0,
|
||||
-12.15
|
||||
]
|
||||
],
|
||||
"v": [
|
||||
[
|
||||
0,
|
||||
-22
|
||||
],
|
||||
[
|
||||
22,
|
||||
0
|
||||
],
|
||||
[
|
||||
0,
|
||||
22
|
||||
],
|
||||
[
|
||||
-22,
|
||||
0
|
||||
]
|
||||
],
|
||||
"c": true
|
||||
},
|
||||
"ix": 2
|
||||
},
|
||||
"nm": "Tracciato 1",
|
||||
"mn": "ADBE Vector Shape - Group",
|
||||
"hd": false
|
||||
},
|
||||
{
|
||||
"ty": "st",
|
||||
"c": {
|
||||
"a": 0,
|
||||
"k": [
|
||||
0.956862804936,
|
||||
0.290196078431,
|
||||
0.239215701234,
|
||||
1
|
||||
],
|
||||
"ix": 3
|
||||
},
|
||||
"o": {
|
||||
"a": 0,
|
||||
"k": 100,
|
||||
"ix": 4
|
||||
},
|
||||
"w": {
|
||||
"a": 0,
|
||||
"k": 3,
|
||||
"ix": 5
|
||||
},
|
||||
"lc": 2,
|
||||
"lj": 2,
|
||||
"bm": 0,
|
||||
"nm": "Traccia 1",
|
||||
"mn": "ADBE Vector Graphic - Stroke",
|
||||
"hd": false
|
||||
},
|
||||
{
|
||||
"ty": "tr",
|
||||
"p": {
|
||||
"a": 0,
|
||||
"k": [
|
||||
29.5,
|
||||
29.5
|
||||
],
|
||||
"ix": 2
|
||||
},
|
||||
"a": {
|
||||
"a": 0,
|
||||
"k": [
|
||||
0,
|
||||
0
|
||||
],
|
||||
"ix": 1
|
||||
},
|
||||
"s": {
|
||||
"a": 0,
|
||||
"k": [
|
||||
100,
|
||||
100
|
||||
],
|
||||
"ix": 3
|
||||
},
|
||||
"r": {
|
||||
"a": 0,
|
||||
"k": 0,
|
||||
"ix": 6
|
||||
},
|
||||
"o": {
|
||||
"a": 0,
|
||||
"k": 100,
|
||||
"ix": 7
|
||||
},
|
||||
"sk": {
|
||||
"a": 0,
|
||||
"k": 0,
|
||||
"ix": 4
|
||||
},
|
||||
"sa": {
|
||||
"a": 0,
|
||||
"k": 0,
|
||||
"ix": 5
|
||||
},
|
||||
"nm": "Transform"
|
||||
}
|
||||
],
|
||||
"nm": "Gruppo 1",
|
||||
"np": 2,
|
||||
"cix": 2,
|
||||
"bm": 0,
|
||||
"ix": 1,
|
||||
"mn": "ADBE Vector Group",
|
||||
"hd": false
|
||||
},
|
||||
{
|
||||
"ty": "tm",
|
||||
"s": {
|
||||
"a": 1,
|
||||
"k": [
|
||||
{
|
||||
"i": {
|
||||
"x": [
|
||||
0.833
|
||||
],
|
||||
"y": [
|
||||
0.833
|
||||
]
|
||||
},
|
||||
"o": {
|
||||
"x": [
|
||||
0.167
|
||||
],
|
||||
"y": [
|
||||
0.167
|
||||
]
|
||||
},
|
||||
"t": 0,
|
||||
"s": [
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"t": 36,
|
||||
"s": [
|
||||
0
|
||||
]
|
||||
}
|
||||
],
|
||||
"ix": 1
|
||||
},
|
||||
"e": {
|
||||
"a": 1,
|
||||
"k": [
|
||||
{
|
||||
"i": {
|
||||
"x": [
|
||||
0.833
|
||||
],
|
||||
"y": [
|
||||
0.833
|
||||
]
|
||||
},
|
||||
"o": {
|
||||
"x": [
|
||||
0.167
|
||||
],
|
||||
"y": [
|
||||
0.167
|
||||
]
|
||||
},
|
||||
"t": 0,
|
||||
"s": [
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"t": 36,
|
||||
"s": [
|
||||
100
|
||||
]
|
||||
}
|
||||
],
|
||||
"ix": 2
|
||||
},
|
||||
"o": {
|
||||
"a": 0,
|
||||
"k": 0,
|
||||
"ix": 3
|
||||
},
|
||||
"m": 1,
|
||||
"ix": 2,
|
||||
"nm": "Taglia tracciati 1",
|
||||
"mn": "ADBE Vector Filter - Trim",
|
||||
"hd": false
|
||||
},
|
||||
{
|
||||
"ty": "rd",
|
||||
"nm": "Angoli arrotondati 1",
|
||||
"r": {
|
||||
"a": 0,
|
||||
"k": 10,
|
||||
"ix": 1
|
||||
},
|
||||
"ix": 3,
|
||||
"mn": "ADBE Vector Filter - RC",
|
||||
"hd": false
|
||||
}
|
||||
],
|
||||
"ip": 0,
|
||||
"op": 57,
|
||||
"st": 0,
|
||||
"bm": 0
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"layers": [
|
||||
{
|
||||
"ddd": 0,
|
||||
"ind": 1,
|
||||
"ty": 0,
|
||||
"nm": "Warning_2",
|
||||
"refId": "comp_0",
|
||||
"sr": 1,
|
||||
"ks": {
|
||||
"o": {
|
||||
"a": 0,
|
||||
"k": 100,
|
||||
"ix": 11
|
||||
},
|
||||
"r": {
|
||||
"a": 0,
|
||||
"k": 0,
|
||||
"ix": 10
|
||||
},
|
||||
"p": {
|
||||
"a": 0,
|
||||
"k": [
|
||||
530,
|
||||
530,
|
||||
0
|
||||
],
|
||||
"ix": 2,
|
||||
"l": 2
|
||||
},
|
||||
"a": {
|
||||
"a": 0,
|
||||
"k": [
|
||||
24,
|
||||
24,
|
||||
0
|
||||
],
|
||||
"ix": 1,
|
||||
"l": 2
|
||||
},
|
||||
"s": {
|
||||
"a": 0,
|
||||
"k": [
|
||||
2000,
|
||||
2000,
|
||||
100
|
||||
],
|
||||
"ix": 6,
|
||||
"l": 2
|
||||
}
|
||||
},
|
||||
"ao": 0,
|
||||
"w": 48,
|
||||
"h": 48,
|
||||
"ip": 0,
|
||||
"op": 57,
|
||||
"st": 0,
|
||||
"bm": 0
|
||||
}
|
||||
],
|
||||
"markers": []
|
||||
}
|
1
example/assets/Tests/SplitPathTransform.json
Normal file
1
example/assets/Tests/SplitPathTransform.json
Normal file
@ -0,0 +1 @@
|
||||
{"v":"5.7.4","fr":60,"ip":0,"op":63,"w":400,"h":400,"nm":"Comp 1","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Shape Layer 1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"s":true,"x":{"a":1,"k":[{"i":{"x":[0.984],"y":[0.777]},"o":{"x":[0.411],"y":[0.047]},"t":0,"s":[200]},{"t":62,"s":[460]}],"ix":3},"y":{"a":1,"k":[{"i":{"x":[0.926],"y":[0.943]},"o":{"x":[0.028],"y":[1.152]},"t":0,"s":[200]},{"t":62,"s":[460]}],"ix":4}},"a":{"a":0,"k":[0,0,0],"ix":1,"l":2},"s":{"a":0,"k":[100,100,100],"ix":6,"l":2}},"ao":0,"shapes":[{"ty":"gr","it":[{"ty":"rc","d":1,"s":{"a":0,"k":[119.332,119.332],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"r":{"a":0,"k":0,"ix":4},"nm":"Rectangle Path 1","mn":"ADBE Vector Shape - Rect","hd":false},{"ty":"fl","c":{"a":0,"k":[1,0,0,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[-130.404,-126.932],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Rectangle 1","np":2,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":63,"st":0,"bm":0}],"markers":[]}
|
2039
example/assets/Tests/TextWithPsCenter.json
Normal file
2039
example/assets/Tests/TextWithPsCenter.json
Normal file
File diff suppressed because it is too large
Load Diff
1626
example/assets/Tests/TextWithPsLeft.json
Normal file
1626
example/assets/Tests/TextWithPsLeft.json
Normal file
File diff suppressed because it is too large
Load Diff
1
example/assets/Tests/Thumb.json
Normal file
1
example/assets/Tests/Thumb.json
Normal file
@ -0,0 +1 @@
|
||||
{"v":"5.9.6","fr":29.9700012207031,"ip":0,"op":190.000007738859,"w":24,"h":24,"nm":"Thumb","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Shape Layer 1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[12,12,0],"ix":2,"l":2},"a":{"a":0,"k":[0,0,0],"ix":1,"l":2},"s":{"a":0,"k":[100,100,100],"ix":6,"l":2}},"ao":0,"shapes":[{"ty":"gr","it":[{"ty":"sr","sy":1,"d":1,"pt":{"a":0,"k":5,"ix":3},"p":{"a":0,"k":[0,0],"ix":4},"r":{"a":0,"k":0,"ix":5},"ir":{"a":0,"k":5,"ix":6},"is":{"a":0,"k":0,"ix":8},"or":{"a":0,"k":12,"ix":7},"os":{"a":0,"k":0,"ix":9},"ix":1,"nm":"Polystar Path 1","mn":"ADBE Vector Shape - Star","hd":false},{"ty":"st","c":{"a":0,"k":[1,0.922702133656,0,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":2,"ix":5},"lc":1,"lj":1,"ml":4,"bm":0,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"fl","c":{"a":0,"k":[1,0,0,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Polystar 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":190.000007738859,"st":0,"ct":1,"bm":0}],"markers":[]}
|
1
example/assets/Tests/TimeStretchAndStartOffset.json
Normal file
1
example/assets/Tests/TimeStretchAndStartOffset.json
Normal file
@ -0,0 +1 @@
|
||||
{"v":"5.5.8","fr":60,"ip":0,"op":166,"w":828,"h":1215,"nm":"Залитые дуги 10 + opacity","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Sinie 2","td":1,"sr":1.53474205216067,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[413.199,607.88,0],"ix":2},"a":{"a":0,"k":[168.949,195.88,0],"ix":1},"s":{"a":0,"k":[207.219,207.219,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[11.998,6.913],[13.844,0.193],[-28.149,-0.401]],"o":[[-11.991,-6.921],[14.447,24.162],[-7.102,-11.886]],"v":[[5.137,-8.915],[-34.263,-19.764],[34.265,19.754]],"c":true},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ind":1,"ty":"sh","ix":2,"ks":{"a":0,"k":{"i":[[0,0],[-14.745,-25.464],[0.311,-0.18],[0.113,0],[14.745,25.466],[-0.31,0.179],[-0.114,0]],"o":[[29.425,0.007],[0.178,0.311],[-0.098,0.056],[-29.427,-0.005],[-0.179,-0.31],[0.099,-0.057],[0,0]],"v":[[-35.4,-21.063],[35.964,20.09],[35.725,20.977],[35.403,21.063],[-35.963,-20.09],[-35.725,-20.976],[-35.401,-21.063]],"c":true},"ix":2},"nm":"Path 2","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"fl","c":{"a":0,"k":[0.894117706897,0,1,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[132.535,174.966],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Group 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":48,"op":166,"st":-37.8760708166762,"bm":0},{"ddd":0,"ind":2,"ty":4,"nm":"Krug siniy 2","tt":1,"sr":0.98917079207921,"ks":{"o":{"a":0,"k":50,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[412.455,610.955,0],"ix":2},"a":{"a":0,"k":[135.603,464.717,0],"ix":1},"s":{"a":1,"k":[{"i":{"x":[0.667,0.667,0.667],"y":[0.252,0.252,1]},"o":{"x":[0.333,0.333,0.333],"y":[0,0,0]},"t":55,"s":[0,0,100]},{"t":111.000102732441,"s":[79.385,79.385,100]}],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,105.185],[105.185,0],[0,-105.185],[-105.186,0]],"o":[[0,-105.185],[-105.186,0],[0,105.185],[105.185,0]],"v":[[190.455,0],[0,-190.455],[-190.455,0],[0,190.456]],"c":true},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"fl","c":{"a":0,"k":[1,0,0,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[135.603,464.717],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[174.179,174.179],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Group 1","np":2,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":48,"op":166,"st":25.2165841584158,"bm":0}],"markers":[]}
|
4841
example/assets/Tests/TrimPathWrapAround.json
Normal file
4841
example/assets/Tests/TrimPathWrapAround.json
Normal file
File diff suppressed because it is too large
Load Diff
BIN
example/assets/Tests/ZipInlineImage.zip
Normal file
BIN
example/assets/Tests/ZipInlineImage.zip
Normal file
Binary file not shown.
BIN
example/assets/Tests/anim_jpg.zip
Normal file
BIN
example/assets/Tests/anim_jpg.zip
Normal file
Binary file not shown.
2492
example/assets/Tests/wile.json
Normal file
2492
example/assets/Tests/wile.json
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>IDEDidComputeMac32BitWarning</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>PreviewsEnabled</key>
|
||||
<false/>
|
||||
</dict>
|
||||
</plist>
|
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>PreviewsEnabled</key>
|
||||
<false/>
|
||||
</dict>
|
||||
</plist>
|
@ -5,7 +5,7 @@ import 'package:lottie/lottie.dart';
|
||||
void main() => runApp(const App());
|
||||
|
||||
class App extends StatelessWidget {
|
||||
const App({Key? key}) : super(key: key);
|
||||
const App({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@ -25,7 +25,7 @@ class __PageState extends State<_Page> {
|
||||
void initState() {
|
||||
super.initState();
|
||||
|
||||
SchedulerBinding.instance!.addPostFrameCallback((_) => _showLoader());
|
||||
SchedulerBinding.instance.addPostFrameCallback((_) => _showLoader());
|
||||
}
|
||||
|
||||
void _showLoader() {
|
||||
|
@ -6,7 +6,7 @@ void main() async {
|
||||
}
|
||||
|
||||
class App extends StatelessWidget {
|
||||
const App({Key? key}) : super(key: key);
|
||||
const App({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
@ -4,10 +4,10 @@ import 'package:lottie/lottie.dart';
|
||||
void main() => runApp(const MyApp());
|
||||
|
||||
class MyApp extends StatefulWidget {
|
||||
const MyApp({Key? key}) : super(key: key);
|
||||
const MyApp({super.key});
|
||||
|
||||
@override
|
||||
_MyAppState createState() => _MyAppState();
|
||||
State<MyApp> createState() => _MyAppState();
|
||||
}
|
||||
|
||||
class _MyAppState extends State<MyApp> with TickerProviderStateMixin {
|
||||
|
@ -12,10 +12,10 @@ import 'package:lottie/lottie.dart';
|
||||
void main() => runApp(const MyApp());
|
||||
|
||||
class MyApp extends StatefulWidget {
|
||||
const MyApp({Key? key}) : super(key: key);
|
||||
const MyApp({super.key});
|
||||
|
||||
@override
|
||||
_MyAppState createState() => _MyAppState();
|
||||
State<MyApp> createState() => _MyAppState();
|
||||
}
|
||||
|
||||
class _MyAppState extends State<MyApp> with TickerProviderStateMixin {
|
||||
|
@ -4,7 +4,7 @@ import 'package:lottie/lottie.dart';
|
||||
void main() => runApp(const MyApp());
|
||||
|
||||
class MyApp extends StatelessWidget {
|
||||
const MyApp({Key? key}) : super(key: key);
|
||||
const MyApp({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
59
example/lib/examples/cache.dart
Normal file
59
example/lib/examples/cache.dart
Normal file
@ -0,0 +1,59 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:lottie/lottie.dart';
|
||||
|
||||
void main() => runApp(const App());
|
||||
|
||||
class App extends StatelessWidget {
|
||||
const App({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MaterialApp(
|
||||
home: Scaffold(body: _Page()),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class _Page extends StatefulWidget {
|
||||
@override
|
||||
__PageState createState() => __PageState();
|
||||
}
|
||||
|
||||
class __PageState extends State<_Page> {
|
||||
var _animationKey = UniqueKey();
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Column(
|
||||
children: [
|
||||
Lottie.network(
|
||||
'https://assets10.lottiefiles.com/datafiles/QeC7XD39x4C1CIj/data.json',
|
||||
key: _animationKey,
|
||||
fit: BoxFit.contain,
|
||||
width: 200,
|
||||
height: 200,
|
||||
),
|
||||
ElevatedButton(
|
||||
onPressed: () {
|
||||
Lottie.cache.clear();
|
||||
Lottie.cache.maximumSize = 10;
|
||||
},
|
||||
child: const Text('Clear cache'),
|
||||
),
|
||||
ElevatedButton(
|
||||
onPressed: () {
|
||||
setState(() {
|
||||
_animationKey = UniqueKey();
|
||||
});
|
||||
},
|
||||
child: const Text('Recreate animation'),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
@ -1,12 +1,11 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:lottie/lottie.dart';
|
||||
|
||||
void main() => runApp(const MyApp());
|
||||
|
||||
class MyApp extends StatelessWidget {
|
||||
const MyApp({Key? key}) : super(key: key);
|
||||
const MyApp({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@ -19,10 +18,10 @@ class MyApp extends StatelessWidget {
|
||||
}
|
||||
|
||||
class MyWidget extends StatefulWidget {
|
||||
const MyWidget({Key? key}) : super(key: key);
|
||||
const MyWidget({super.key});
|
||||
|
||||
@override
|
||||
_MyWidgetState createState() => _MyWidgetState();
|
||||
State<MyWidget> createState() => _MyWidgetState();
|
||||
}
|
||||
|
||||
class _MyWidgetState extends State<MyWidget> {
|
||||
@ -61,7 +60,7 @@ class _MyWidgetState extends State<MyWidget> {
|
||||
class CustomDrawer extends StatelessWidget {
|
||||
final LottieComposition composition;
|
||||
|
||||
const CustomDrawer(this.composition, {Key? key}) : super(key: key);
|
||||
const CustomDrawer(this.composition, {super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
@ -1,12 +1,11 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:lottie/lottie.dart';
|
||||
|
||||
void main() => runApp(const MyApp());
|
||||
|
||||
class MyApp extends StatelessWidget {
|
||||
const MyApp({Key? key}) : super(key: key);
|
||||
const MyApp({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@ -20,10 +19,10 @@ class MyApp extends StatelessWidget {
|
||||
|
||||
//--- example
|
||||
class MyWidget extends StatefulWidget {
|
||||
const MyWidget({Key? key}) : super(key: key);
|
||||
const MyWidget({super.key});
|
||||
|
||||
@override
|
||||
_MyWidgetState createState() => _MyWidgetState();
|
||||
State<MyWidget> createState() => _MyWidgetState();
|
||||
}
|
||||
|
||||
class _MyWidgetState extends State<MyWidget> {
|
||||
|
@ -4,7 +4,7 @@ import 'package:lottie/lottie.dart';
|
||||
void main() => runApp(const MyApp());
|
||||
|
||||
class MyApp extends StatelessWidget {
|
||||
const MyApp({Key? key}) : super(key: key);
|
||||
const MyApp({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
@ -1,4 +1,3 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_colorpicker/flutter_colorpicker.dart';
|
||||
import 'package:lottie/lottie.dart';
|
||||
@ -8,10 +7,10 @@ void main() async {
|
||||
}
|
||||
|
||||
class App extends StatefulWidget {
|
||||
const App({Key? key}) : super(key: key);
|
||||
const App({super.key});
|
||||
|
||||
@override
|
||||
_AppState createState() => _AppState();
|
||||
State<App> createState() => _AppState();
|
||||
}
|
||||
|
||||
class _AppState extends State<App> with TickerProviderStateMixin {
|
||||
@ -72,7 +71,7 @@ class _AppState extends State<App> with TickerProviderStateMixin {
|
||||
_color = newColor;
|
||||
});
|
||||
},
|
||||
showLabel: false,
|
||||
labelTypes: const [],
|
||||
enableAlpha: false,
|
||||
pickerAreaHeightPercent: 0.8,
|
||||
),
|
||||
|
@ -7,10 +7,10 @@ void main() async {
|
||||
}
|
||||
|
||||
class App extends StatefulWidget {
|
||||
const App({Key? key}) : super(key: key);
|
||||
const App({super.key});
|
||||
|
||||
@override
|
||||
_AppState createState() => _AppState();
|
||||
State<App> createState() => _AppState();
|
||||
}
|
||||
|
||||
class _AppState extends State<App> with TickerProviderStateMixin {
|
||||
|
@ -4,7 +4,7 @@ import 'package:lottie/lottie.dart';
|
||||
void main() => runApp(const MyApp());
|
||||
|
||||
class MyApp extends StatelessWidget {
|
||||
const MyApp({Key? key}) : super(key: key);
|
||||
const MyApp({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
@ -4,7 +4,7 @@ import 'package:lottie/lottie.dart';
|
||||
void main() => runApp(const MyApp());
|
||||
|
||||
class MyApp extends StatelessWidget {
|
||||
const MyApp({Key? key}) : super(key: key);
|
||||
const MyApp({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
@ -6,10 +6,10 @@ void main() async {
|
||||
}
|
||||
|
||||
class App extends StatefulWidget {
|
||||
const App({Key? key}) : super(key: key);
|
||||
const App({super.key});
|
||||
|
||||
@override
|
||||
_AppState createState() => _AppState();
|
||||
State<App> createState() => _AppState();
|
||||
}
|
||||
|
||||
class _AppState extends State<App> with TickerProviderStateMixin {
|
||||
|
@ -9,10 +9,10 @@ void main() async {
|
||||
}
|
||||
|
||||
class App extends StatefulWidget {
|
||||
const App({Key? key}) : super(key: key);
|
||||
const App({super.key});
|
||||
|
||||
@override
|
||||
_AppState createState() => _AppState();
|
||||
State<App> createState() => _AppState();
|
||||
}
|
||||
|
||||
class _AppState extends State<App> with TickerProviderStateMixin {
|
||||
@ -48,7 +48,7 @@ class _AppState extends State<App> with TickerProviderStateMixin {
|
||||
class _LottieDetails extends StatefulWidget {
|
||||
final LottieComposition composition;
|
||||
|
||||
const _LottieDetails(this.composition, {Key? key}) : super(key: key);
|
||||
const _LottieDetails(this.composition);
|
||||
|
||||
@override
|
||||
_LottieDetailsState createState() => _LottieDetailsState();
|
||||
|
@ -4,10 +4,10 @@ import 'package:lottie/lottie.dart';
|
||||
void main() => runApp(const MyApp());
|
||||
|
||||
class MyApp extends StatefulWidget {
|
||||
const MyApp({Key? key}) : super(key: key);
|
||||
const MyApp({super.key});
|
||||
|
||||
@override
|
||||
_MyAppState createState() => _MyAppState();
|
||||
State<MyApp> createState() => _MyAppState();
|
||||
}
|
||||
|
||||
class _MyAppState extends State<MyApp> with TickerProviderStateMixin {
|
||||
|
@ -12,10 +12,10 @@ void main() async {
|
||||
}
|
||||
|
||||
class App extends StatefulWidget {
|
||||
const App({Key? key}) : super(key: key);
|
||||
const App({super.key});
|
||||
|
||||
@override
|
||||
_AppState createState() => _AppState();
|
||||
State<App> createState() => _AppState();
|
||||
}
|
||||
|
||||
class _AppState extends State<App> with TickerProviderStateMixin {
|
||||
|
@ -10,10 +10,10 @@ import 'package:path_provider/path_provider.dart';
|
||||
void main() => runApp(const MyApp());
|
||||
|
||||
class MyApp extends StatefulWidget {
|
||||
const MyApp({Key? key}) : super(key: key);
|
||||
const MyApp({super.key});
|
||||
|
||||
@override
|
||||
_MyAppState createState() => _MyAppState();
|
||||
State<MyApp> createState() => _MyAppState();
|
||||
}
|
||||
|
||||
class _MyAppState extends State<MyApp> {
|
||||
|
@ -4,7 +4,7 @@ import 'package:lottie/lottie.dart';
|
||||
void main() => runApp(const MyApp());
|
||||
|
||||
class MyApp extends StatelessWidget {
|
||||
const MyApp({Key? key}) : super(key: key);
|
||||
const MyApp({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
@ -4,7 +4,7 @@ import 'package:lottie/lottie.dart';
|
||||
void main() => runApp(const MyApp());
|
||||
|
||||
class MyApp extends StatelessWidget {
|
||||
const MyApp({Key? key}) : super(key: key);
|
||||
const MyApp({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
@ -1,4 +1,3 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:logging/logging.dart';
|
||||
import 'package:lottie/lottie.dart';
|
||||
@ -15,7 +14,7 @@ void main() {
|
||||
}
|
||||
|
||||
class App extends StatelessWidget {
|
||||
const App({Key? key}) : super(key: key);
|
||||
const App({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@ -25,37 +24,37 @@ class App extends StatelessWidget {
|
||||
appBar: AppBar(
|
||||
title: const Text('Lottie Flutter'),
|
||||
),
|
||||
body: Scrollbar(
|
||||
child: GridView.builder(
|
||||
itemCount: files.length,
|
||||
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
|
||||
crossAxisCount: 4),
|
||||
itemBuilder: (context, index) {
|
||||
var assetName = files[index];
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute<void>(
|
||||
builder: (context) => Detail(assetName)));
|
||||
},
|
||||
child: _Item(
|
||||
child: Lottie.asset(
|
||||
assetName,
|
||||
onWarning: (w) => _logger.info('$assetName - $w'),
|
||||
frameBuilder: (context, child, composition) {
|
||||
return AnimatedOpacity(
|
||||
opacity: composition == null ? 0 : 1,
|
||||
duration: const Duration(seconds: 1),
|
||||
curve: Curves.easeOut,
|
||||
child: child,
|
||||
);
|
||||
},
|
||||
),
|
||||
body: GridView.builder(
|
||||
primary: true,
|
||||
itemCount: files.length,
|
||||
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
|
||||
crossAxisCount: 4),
|
||||
itemBuilder: (context, index) {
|
||||
var assetName = files[index];
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute<void>(
|
||||
builder: (context) => Detail(assetName)));
|
||||
},
|
||||
child: _Item(
|
||||
child: Lottie.asset(
|
||||
assetName,
|
||||
fit: BoxFit.contain,
|
||||
onWarning: (w) => _logger.info('$assetName - $w'),
|
||||
frameBuilder: (context, child, composition) {
|
||||
return AnimatedOpacity(
|
||||
opacity: composition == null ? 0 : 1,
|
||||
duration: const Duration(seconds: 1),
|
||||
curve: Curves.easeOut,
|
||||
child: child,
|
||||
);
|
||||
},
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
);
|
||||
@ -65,7 +64,7 @@ class App extends StatelessWidget {
|
||||
class _Item extends StatelessWidget {
|
||||
final Widget child;
|
||||
|
||||
const _Item({Key? key, required this.child}) : super(key: key);
|
||||
const _Item({required this.child});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@ -90,10 +89,10 @@ class _Item extends StatelessWidget {
|
||||
class Detail extends StatefulWidget {
|
||||
final String assetName;
|
||||
|
||||
const Detail(this.assetName, {Key? key}) : super(key: key);
|
||||
const Detail(this.assetName, {super.key});
|
||||
|
||||
@override
|
||||
_DetailState createState() => _DetailState();
|
||||
State<Detail> createState() => _DetailState();
|
||||
}
|
||||
|
||||
class _DetailState extends State<Detail> with TickerProviderStateMixin {
|
||||
|
@ -13,7 +13,7 @@ void main() async {
|
||||
class App extends StatelessWidget {
|
||||
final LottieComposition composition;
|
||||
|
||||
const App({Key? key, required this.composition}) : super(key: key);
|
||||
const App({super.key, required this.composition});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@ -103,8 +103,7 @@ class _Lottie extends StatefulWidget {
|
||||
final AlignmentGeometry? alignment;
|
||||
|
||||
const _Lottie(this.composition,
|
||||
{Key? key, this.width, this.height, this.fit, this.alignment})
|
||||
: super(key: key);
|
||||
{this.width, this.height, this.fit, this.alignment});
|
||||
|
||||
@override
|
||||
__LottieState createState() => __LottieState();
|
||||
|
@ -6,7 +6,7 @@ void main() async {
|
||||
}
|
||||
|
||||
class App extends StatelessWidget {
|
||||
const App({Key? key}) : super(key: key);
|
||||
const App({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
@ -6,7 +6,7 @@ void main() async {
|
||||
}
|
||||
|
||||
class App extends StatelessWidget {
|
||||
const App({Key? key}) : super(key: key);
|
||||
const App({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
11
example/linux/flutter/generated_plugin_registrant.cc
Normal file
11
example/linux/flutter/generated_plugin_registrant.cc
Normal file
@ -0,0 +1,11 @@
|
||||
//
|
||||
// Generated file. Do not edit.
|
||||
//
|
||||
|
||||
// clang-format off
|
||||
|
||||
#include "generated_plugin_registrant.h"
|
||||
|
||||
|
||||
void fl_register_plugins(FlPluginRegistry* registry) {
|
||||
}
|
15
example/linux/flutter/generated_plugin_registrant.h
Normal file
15
example/linux/flutter/generated_plugin_registrant.h
Normal file
@ -0,0 +1,15 @@
|
||||
//
|
||||
// Generated file. Do not edit.
|
||||
//
|
||||
|
||||
// clang-format off
|
||||
|
||||
#ifndef GENERATED_PLUGIN_REGISTRANT_
|
||||
#define GENERATED_PLUGIN_REGISTRANT_
|
||||
|
||||
#include <flutter_linux/flutter_linux.h>
|
||||
|
||||
// Registers Flutter plugins.
|
||||
void fl_register_plugins(FlPluginRegistry* registry);
|
||||
|
||||
#endif // GENERATED_PLUGIN_REGISTRANT_
|
23
example/linux/flutter/generated_plugins.cmake
Normal file
23
example/linux/flutter/generated_plugins.cmake
Normal file
@ -0,0 +1,23 @@
|
||||
#
|
||||
# Generated file, do not edit.
|
||||
#
|
||||
|
||||
list(APPEND FLUTTER_PLUGIN_LIST
|
||||
)
|
||||
|
||||
list(APPEND FLUTTER_FFI_PLUGIN_LIST
|
||||
)
|
||||
|
||||
set(PLUGIN_BUNDLED_LIBRARIES)
|
||||
|
||||
foreach(plugin ${FLUTTER_PLUGIN_LIST})
|
||||
add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/linux plugins/${plugin})
|
||||
target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin)
|
||||
list(APPEND PLUGIN_BUNDLED_LIBRARIES $<TARGET_FILE:${plugin}_plugin>)
|
||||
list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries})
|
||||
endforeach(plugin)
|
||||
|
||||
foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST})
|
||||
add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/linux plugins/${ffi_plugin})
|
||||
list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries})
|
||||
endforeach(ffi_plugin)
|
@ -14,9 +14,9 @@ EXTERNAL SOURCES:
|
||||
:path: Flutter/ephemeral/.symlinks/plugins/path_provider_macos/macos
|
||||
|
||||
SPEC CHECKSUMS:
|
||||
FlutterMacOS: 57701585bf7de1b3fc2bb61f6378d73bbdea8424
|
||||
path_provider_macos: a0a3fd666cb7cd0448e936fb4abad4052961002b
|
||||
FlutterMacOS: ae6af50a8ea7d6103d888583d46bd8328a7e9811
|
||||
path_provider_macos: 3c0c3b4b0d4a76d2bf989a913c2de869c5641a19
|
||||
|
||||
PODFILE CHECKSUM: 6eac6b3292e5142cfc23bdeb71848a40ec51c14c
|
||||
|
||||
COCOAPODS: 1.10.1
|
||||
COCOAPODS: 1.11.3
|
||||
|
@ -7,14 +7,14 @@ packages:
|
||||
name: archive
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "3.1.2"
|
||||
version: "3.3.5"
|
||||
async:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: async
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.5.0"
|
||||
version: "2.9.0"
|
||||
boolean_selector:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -28,56 +28,56 @@ packages:
|
||||
name: characters
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.1.0"
|
||||
charcode:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: charcode
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.2.0"
|
||||
version: "1.2.1"
|
||||
clock:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: clock
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.1.0"
|
||||
version: "1.1.1"
|
||||
collection:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: collection
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.15.0"
|
||||
version: "1.16.0"
|
||||
convert:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: convert
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "3.1.1"
|
||||
crypto:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: crypto
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "3.0.1"
|
||||
version: "3.0.2"
|
||||
fake_async:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: fake_async
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.2.0"
|
||||
version: "1.3.1"
|
||||
ffi:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: ffi
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.1.2"
|
||||
version: "2.0.1"
|
||||
file:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: file
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "6.1.2"
|
||||
version: "6.1.4"
|
||||
flutter:
|
||||
dependency: "direct main"
|
||||
description: flutter
|
||||
@ -89,14 +89,14 @@ packages:
|
||||
name: flutter_colorpicker
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.5.0"
|
||||
version: "1.0.3"
|
||||
flutter_lints:
|
||||
dependency: "direct dev"
|
||||
description:
|
||||
name: flutter_lints
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.0.3"
|
||||
version: "2.0.1"
|
||||
flutter_test:
|
||||
dependency: "direct dev"
|
||||
description: flutter
|
||||
@ -108,126 +108,154 @@ packages:
|
||||
name: golden_toolkit
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.9.0"
|
||||
version: "0.14.0"
|
||||
http:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: http
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.13.3"
|
||||
version: "0.13.5"
|
||||
http_parser:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: http_parser
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "4.0.0"
|
||||
version: "4.0.2"
|
||||
js:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: js
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.6.5"
|
||||
lints:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: lints
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.0.1"
|
||||
version: "2.0.1"
|
||||
logging:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: logging
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.0.1"
|
||||
version: "1.1.0"
|
||||
lottie:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
path: ".."
|
||||
relative: true
|
||||
source: path
|
||||
version: "1.2.0"
|
||||
version: "2.2.0"
|
||||
matcher:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: matcher
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.12.10"
|
||||
version: "0.12.12"
|
||||
material_color_utilities:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: material_color_utilities
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.1.5"
|
||||
meta:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: meta
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.3.0"
|
||||
version: "1.8.0"
|
||||
path:
|
||||
dependency: transitive
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: path
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.8.0"
|
||||
version: "1.8.2"
|
||||
path_provider:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: path_provider
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.0.2"
|
||||
version: "2.0.11"
|
||||
path_provider_android:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: path_provider_android
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.0.22"
|
||||
path_provider_ios:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: path_provider_ios
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.0.11"
|
||||
path_provider_linux:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: path_provider_linux
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.0.0"
|
||||
version: "2.1.7"
|
||||
path_provider_macos:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: path_provider_macos
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.0.0"
|
||||
version: "2.0.6"
|
||||
path_provider_platform_interface:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: path_provider_platform_interface
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.0.1"
|
||||
version: "2.0.5"
|
||||
path_provider_windows:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: path_provider_windows
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.0.1"
|
||||
pedantic:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: pedantic
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.11.1"
|
||||
version: "2.1.3"
|
||||
platform:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: platform
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "3.0.0"
|
||||
version: "3.1.0"
|
||||
plugin_platform_interface:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: plugin_platform_interface
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.0.0"
|
||||
version: "2.1.3"
|
||||
pointycastle:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: pointycastle
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "3.6.2"
|
||||
process:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: process
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "4.2.1"
|
||||
version: "4.2.4"
|
||||
sky_engine:
|
||||
dependency: transitive
|
||||
description: flutter
|
||||
@ -239,7 +267,7 @@ packages:
|
||||
name: source_span
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.8.1"
|
||||
version: "1.9.0"
|
||||
stack_trace:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -260,49 +288,49 @@ packages:
|
||||
name: string_scanner
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.1.0"
|
||||
version: "1.1.1"
|
||||
term_glyph:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: term_glyph
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.2.0"
|
||||
version: "1.2.1"
|
||||
test_api:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: test_api
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.3.0"
|
||||
version: "0.4.12"
|
||||
typed_data:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: typed_data
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.3.0"
|
||||
version: "1.3.1"
|
||||
vector_math:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: vector_math
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.1.0"
|
||||
version: "2.1.2"
|
||||
win32:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: win32
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.2.5"
|
||||
version: "3.1.2"
|
||||
xdg_directories:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: xdg_directories
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.2.0"
|
||||
version: "0.2.0+2"
|
||||
sdks:
|
||||
dart: ">=2.13.0 <3.0.0"
|
||||
flutter: ">=1.20.0"
|
||||
dart: ">=2.18.4 <3.0.0"
|
||||
flutter: ">=3.3.0"
|
||||
|
@ -3,7 +3,7 @@ description: A sample app for the Lottie player
|
||||
publish_to: none
|
||||
|
||||
environment:
|
||||
sdk: ">=2.12.0-0 <3.0.0"
|
||||
sdk: ">=2.18.0 <3.0.0"
|
||||
|
||||
dependencies:
|
||||
flutter:
|
||||
@ -13,6 +13,7 @@ dependencies:
|
||||
logging:
|
||||
lottie:
|
||||
path: ../
|
||||
path:
|
||||
path_provider:
|
||||
|
||||
dev_dependencies:
|
||||
|
BIN
example/web/favicon.png
Normal file
BIN
example/web/favicon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 917 B |
BIN
example/web/icons/Icon-192.png
Normal file
BIN
example/web/icons/Icon-192.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 5.2 KiB |
BIN
example/web/icons/Icon-512.png
Normal file
BIN
example/web/icons/Icon-512.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 8.1 KiB |
BIN
example/web/icons/Icon-maskable-192.png
Normal file
BIN
example/web/icons/Icon-maskable-192.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 5.5 KiB |
BIN
example/web/icons/Icon-maskable-512.png
Normal file
BIN
example/web/icons/Icon-maskable-512.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 20 KiB |
35
example/web/manifest.json
Normal file
35
example/web/manifest.json
Normal file
@ -0,0 +1,35 @@
|
||||
{
|
||||
"name": "example",
|
||||
"short_name": "example",
|
||||
"start_url": ".",
|
||||
"display": "standalone",
|
||||
"background_color": "#0175C2",
|
||||
"theme_color": "#0175C2",
|
||||
"description": "A new Flutter project.",
|
||||
"orientation": "portrait-primary",
|
||||
"prefer_related_applications": false,
|
||||
"icons": [
|
||||
{
|
||||
"src": "icons/Icon-192.png",
|
||||
"sizes": "192x192",
|
||||
"type": "image/png"
|
||||
},
|
||||
{
|
||||
"src": "icons/Icon-512.png",
|
||||
"sizes": "512x512",
|
||||
"type": "image/png"
|
||||
},
|
||||
{
|
||||
"src": "icons/Icon-maskable-192.png",
|
||||
"sizes": "192x192",
|
||||
"type": "image/png",
|
||||
"purpose": "maskable"
|
||||
},
|
||||
{
|
||||
"src": "icons/Icon-maskable-512.png",
|
||||
"sizes": "512x512",
|
||||
"type": "image/png",
|
||||
"purpose": "maskable"
|
||||
}
|
||||
]
|
||||
}
|
@ -10,7 +10,7 @@ export 'src/options.dart' show LottieOptions;
|
||||
export 'src/providers/asset_provider.dart' show AssetLottie;
|
||||
export 'src/providers/file_provider.dart' show FileLottie;
|
||||
export 'src/providers/load_image.dart' show LottieImageProviderFactory;
|
||||
export 'src/providers/lottie_provider.dart' show LottieProvider;
|
||||
export 'src/providers/lottie_provider.dart' show LottieProvider, LottieCache;
|
||||
export 'src/providers/memory_provider.dart' show MemoryLottie;
|
||||
export 'src/providers/network_provider.dart' show NetworkLottie;
|
||||
export 'src/raw_lottie.dart' show RawLottie;
|
||||
|
@ -196,7 +196,8 @@ abstract class BaseStrokeContent
|
||||
void _applyTrimPath(
|
||||
Canvas canvas, _PathGroup pathGroup, Matrix4 parentMatrix) {
|
||||
L.beginSection('StrokeContent#applyTrimPath');
|
||||
if (pathGroup.trimPath == null) {
|
||||
var trimPath = pathGroup.trimPath;
|
||||
if (trimPath == null) {
|
||||
L.endSection('StrokeContent#applyTrimPath');
|
||||
return;
|
||||
}
|
||||
@ -205,13 +206,24 @@ abstract class BaseStrokeContent
|
||||
_path.addPath(pathGroup.paths[j].getPath(), Offset.zero,
|
||||
matrix4: parentMatrix.storage);
|
||||
}
|
||||
var animStartValue = trimPath.start.value / 100;
|
||||
var animEndValue = trimPath.end.value / 100;
|
||||
var animOffsetValue = trimPath.offset.value / 360;
|
||||
|
||||
// If the start-end is ~100, consider it to be the full path.
|
||||
if (animStartValue < 0.01 && animEndValue > 0.99) {
|
||||
canvas.drawPath(_path, paint);
|
||||
L.endSection('StrokeContent#applyTrimPath');
|
||||
return;
|
||||
}
|
||||
|
||||
var pathMetrics = _path.computeMetrics().toList();
|
||||
var totalLength = pathMetrics.fold<double>(0.0, (a, b) => a + b.length);
|
||||
|
||||
var trimPath = pathGroup.trimPath!;
|
||||
var offsetLength = totalLength * trimPath.offset.value / 360.0;
|
||||
var startLength = totalLength * trimPath.start.value / 100.0 + offsetLength;
|
||||
var endLength = totalLength * trimPath.end.value / 100.0 + offsetLength;
|
||||
var offsetLength = totalLength * animOffsetValue;
|
||||
var startLength = totalLength * animStartValue + offsetLength;
|
||||
var endLength = min(totalLength * animEndValue + offsetLength,
|
||||
startLength + totalLength - 1);
|
||||
|
||||
var currentLength = 0.0;
|
||||
for (var j = pathGroup.paths.length - 1; j >= 0; j--) {
|
||||
|
@ -52,8 +52,8 @@ class ContentGroup implements DrawingContent, PathContent, KeyPathElement {
|
||||
List<PathContent>? _pathContents;
|
||||
TransformKeyframeAnimation? _transformAnimation;
|
||||
|
||||
ContentGroup(final LottieDrawable lottieDrawable, BaseLayer layer,
|
||||
ShapeGroup shapeGroup)
|
||||
ContentGroup(
|
||||
LottieDrawable lottieDrawable, BaseLayer layer, ShapeGroup shapeGroup)
|
||||
: this.copy(
|
||||
lottieDrawable,
|
||||
layer,
|
||||
|
@ -31,8 +31,8 @@ class GradientStrokeContent extends BaseStrokeContent {
|
||||
ValueCallbackKeyframeAnimation<List<Color>, List<Color>>?
|
||||
_colorCallbackAnimation;
|
||||
|
||||
GradientStrokeContent(final LottieDrawable lottieDrawable, BaseLayer layer,
|
||||
GradientStroke stroke)
|
||||
GradientStrokeContent(
|
||||
LottieDrawable lottieDrawable, BaseLayer layer, GradientStroke stroke)
|
||||
: name = stroke.name,
|
||||
_type = stroke.gradientType,
|
||||
_hidden = stroke.hidden,
|
||||
|
@ -134,6 +134,9 @@ class PolystarContent implements PathContent, KeyPathElementContent {
|
||||
currentAngle = radians(currentAngle);
|
||||
// adjust current angle for partial points
|
||||
var anglePerPoint = 2 * pi / points;
|
||||
if (_polystarShape.isReversed) {
|
||||
anglePerPoint *= -1;
|
||||
}
|
||||
var halfAnglePerPoint = anglePerPoint / 2.0;
|
||||
var partialPointAmount = points - points.toInt();
|
||||
if (partialPointAmount != 0) {
|
||||
|
@ -15,6 +15,7 @@ import 'compound_trim_path_content.dart';
|
||||
import 'content.dart';
|
||||
import 'key_path_element_content.dart';
|
||||
import 'path_content.dart';
|
||||
import 'rounded_corners_content.dart';
|
||||
import 'trim_path_content.dart';
|
||||
|
||||
class RectangleContent implements KeyPathElementContent, PathContent {
|
||||
@ -29,6 +30,9 @@ class RectangleContent implements KeyPathElementContent, PathContent {
|
||||
final BaseKeyframeAnimation<Object, double> _cornerRadiusAnimation;
|
||||
|
||||
final CompoundTrimPathContent _trimPaths = CompoundTrimPathContent();
|
||||
|
||||
/// This corner radius is from a layer item. The first one is from the roundedness on this specific rect.
|
||||
BaseKeyframeAnimation<double, double>? _roundedCornersAnimation;
|
||||
bool _isPathValid = false;
|
||||
|
||||
RectangleContent(
|
||||
@ -61,6 +65,8 @@ class RectangleContent implements KeyPathElementContent, PathContent {
|
||||
var trimPath = content;
|
||||
_trimPaths.addTrimPath(trimPath);
|
||||
trimPath.addListener(invalidate);
|
||||
} else if (content is RoundedCornersContent) {
|
||||
_roundedCornersAnimation = content.roundedCorners;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -82,6 +88,10 @@ class RectangleContent implements KeyPathElementContent, PathContent {
|
||||
var halfWidth = size.dx / 2.0;
|
||||
var halfHeight = size.dy / 2.0;
|
||||
var radius = _cornerRadiusAnimation.value;
|
||||
var roundedCornersAnimation = _roundedCornersAnimation;
|
||||
if (radius == 0 && roundedCornersAnimation != null) {
|
||||
radius = min(roundedCornersAnimation.value, min(halfWidth, halfHeight));
|
||||
}
|
||||
var maxRadius = min(halfWidth, halfHeight);
|
||||
if (radius > maxRadius) {
|
||||
radius = maxRadius;
|
||||
|
236
lib/src/animation/content/rounded_corners_content.dart
Normal file
236
lib/src/animation/content/rounded_corners_content.dart
Normal file
@ -0,0 +1,236 @@
|
||||
import 'dart:math' as math;
|
||||
import 'dart:ui';
|
||||
import '../../lottie_drawable.dart';
|
||||
import '../../model/content/rounded_corners.dart';
|
||||
import '../../model/content/shape_data.dart';
|
||||
import '../../model/cubic_curve_data.dart';
|
||||
import '../../model/layer/base_layer.dart';
|
||||
import '../../utils.dart';
|
||||
import '../keyframe/base_keyframe_animation.dart';
|
||||
import 'content.dart';
|
||||
import 'shape_modifier_content.dart';
|
||||
|
||||
class RoundedCornersContent implements ShapeModifierContent {
|
||||
/// Copied from:
|
||||
/// https://github.com/airbnb/lottie-web/blob/bb71072a26e03f1ca993da60915860f39aae890b/player/js/utils/common.js#L47
|
||||
static const _roundedCornerMagicNumber = 0.5519;
|
||||
|
||||
final LottieDrawable lottieDrawable;
|
||||
|
||||
@override
|
||||
final String name;
|
||||
final BaseKeyframeAnimation<double, double> roundedCorners;
|
||||
ShapeData? shapeData;
|
||||
|
||||
RoundedCornersContent(
|
||||
this.lottieDrawable, BaseLayer layer, RoundedCorners roundedCorners)
|
||||
: name = roundedCorners.name,
|
||||
roundedCorners = roundedCorners.cornerRadius.createAnimation() {
|
||||
layer.addAnimation(this.roundedCorners);
|
||||
this.roundedCorners.addUpdateListener(_onValueChanged);
|
||||
}
|
||||
|
||||
void _onValueChanged() {
|
||||
lottieDrawable.invalidateSelf();
|
||||
}
|
||||
|
||||
@override
|
||||
void setContents(List<Content> contentsBefore, List<Content> contentsAfter) {
|
||||
// Do nothing.
|
||||
}
|
||||
|
||||
/// Rounded corner algorithm:
|
||||
/// Iterate through each vertex.
|
||||
/// If a vertex is a sharp corner, it rounds it.
|
||||
/// If a vertex has control points, it is already rounded, so it does nothing.
|
||||
/// <p>
|
||||
/// To round a vertex:
|
||||
/// Split the vertex into two.
|
||||
/// Move vertex 1 directly towards the previous vertex.
|
||||
/// Set vertex 1's in control point to itself so it is not rounded on that side.
|
||||
/// Extend vertex 1's out control point towards the original vertex.
|
||||
/// <p>
|
||||
/// Repeat for vertex 2:
|
||||
/// Move vertex 2 directly towards the next vertex.
|
||||
/// Set vertex 2's out point to itself so it is not rounded on that side.
|
||||
/// Extend vertex 2's in control point towards the original vertex.
|
||||
/// <p>
|
||||
/// The distance that the vertices and control points are moved are relative to the
|
||||
/// shape's vertex distances and the roundedness set in the animation.
|
||||
@override
|
||||
ShapeData modifyShape(ShapeData startingShapeData) {
|
||||
var startingCurves = startingShapeData.curves;
|
||||
if (startingCurves.length <= 2) {
|
||||
return startingShapeData;
|
||||
}
|
||||
var roundedness = roundedCorners.value;
|
||||
if (roundedness == 0) {
|
||||
return startingShapeData;
|
||||
}
|
||||
|
||||
var modifiedShapeData = _getShapeData(startingShapeData);
|
||||
modifiedShapeData.setInitialPoint(
|
||||
startingShapeData.initialPoint.dx, startingShapeData.initialPoint.dy);
|
||||
var modifiedCurves = modifiedShapeData.curves;
|
||||
var modifiedCurvesIndex = 0;
|
||||
var isClosed = startingShapeData.isClosed;
|
||||
|
||||
// i represents which vertex we are currently on. Refer to the docs of CubicCurveData prior to working with
|
||||
// this code.
|
||||
// When i == 0
|
||||
// vertex=ShapeData.initialPoint
|
||||
// inCp=if closed vertex else curves[size - 1].cp2
|
||||
// outCp=curves[0].cp1
|
||||
// When i == 1
|
||||
// vertex=curves[0].vertex
|
||||
// inCp=curves[0].cp2
|
||||
// outCp=curves[1].cp1.
|
||||
// When i == size - 1
|
||||
// vertex=curves[size - 1].vertex
|
||||
// inCp=curves[size - 1].cp2
|
||||
// outCp=if closed vertex else curves[0].cp1
|
||||
for (var i = 0; i < startingCurves.length; i++) {
|
||||
var startingCurve = startingCurves[i];
|
||||
var previousCurve =
|
||||
startingCurves[floorMod(i - 1, startingCurves.length)];
|
||||
var previousPreviousCurve =
|
||||
startingCurves[floorMod(i - 2, startingCurves.length)];
|
||||
var vertex = (i == 0 && !isClosed)
|
||||
? startingShapeData.initialPoint
|
||||
: previousCurve.vertex;
|
||||
var inPoint =
|
||||
(i == 0 && !isClosed) ? vertex : previousCurve.controlPoint2;
|
||||
var outPoint = startingCurve.controlPoint1;
|
||||
var previousVertex = previousPreviousCurve.vertex;
|
||||
var nextVertex = startingCurve.vertex;
|
||||
|
||||
// We can't round the corner of the end of a non-closed curve.
|
||||
var isEndOfCurve = !startingShapeData.isClosed &&
|
||||
(i == 0 && i == startingCurves.length - 1);
|
||||
if (inPoint == vertex && outPoint == vertex && !isEndOfCurve) {
|
||||
// This vertex is a point. Round its corners
|
||||
var dxToPreviousVertex = vertex.dx - previousVertex.dx;
|
||||
var dyToPreviousVertex = vertex.dy - previousVertex.dy;
|
||||
var dxToNextVertex = nextVertex.dx - vertex.dx;
|
||||
var dyToNextVertex = nextVertex.dy - vertex.dy;
|
||||
|
||||
var dToPreviousVertex = hypot(dxToPreviousVertex, dyToPreviousVertex);
|
||||
var dToNextVertex = hypot(dxToNextVertex, dyToNextVertex);
|
||||
|
||||
double previousVertexPercent =
|
||||
math.min(roundedness / dToPreviousVertex, 0.5);
|
||||
double nextVertexPercent = math.min(roundedness / dToNextVertex, 0.5);
|
||||
|
||||
// Split the vertex into two and move each vertex towards the previous/next vertex.
|
||||
var newVertex1X =
|
||||
vertex.dx + (previousVertex.dx - vertex.dx) * previousVertexPercent;
|
||||
var newVertex1Y =
|
||||
vertex.dy + (previousVertex.dy - vertex.dy) * previousVertexPercent;
|
||||
var newVertex2X =
|
||||
vertex.dx + (nextVertex.dx - vertex.dx) * nextVertexPercent;
|
||||
var newVertex2Y =
|
||||
vertex.dy + (nextVertex.dy - vertex.dy) * nextVertexPercent;
|
||||
|
||||
// Extend the new vertex control point towards the original vertex.
|
||||
var newVertex1OutPointX =
|
||||
newVertex1X - (newVertex1X - vertex.dx) * _roundedCornerMagicNumber;
|
||||
var newVertex1OutPointY =
|
||||
newVertex1Y - (newVertex1Y - vertex.dy) * _roundedCornerMagicNumber;
|
||||
var newVertex2InPointX =
|
||||
newVertex2X - (newVertex2X - vertex.dx) * _roundedCornerMagicNumber;
|
||||
var newVertex2InPointY =
|
||||
newVertex2Y - (newVertex2Y - vertex.dy) * _roundedCornerMagicNumber;
|
||||
|
||||
// Remap vertex/in/out point to CubicCurveData.
|
||||
// Refer to the docs for CubicCurveData for more info on the difference.
|
||||
var previousCurveData = modifiedCurves[
|
||||
floorMod(modifiedCurvesIndex - 1, modifiedCurves.length)];
|
||||
var currentCurveData = modifiedCurves[modifiedCurvesIndex];
|
||||
previousCurveData.controlPoint2 = Offset(newVertex1X, newVertex1Y);
|
||||
previousCurveData.vertex = Offset(newVertex1X, newVertex1Y);
|
||||
if (i == 0) {
|
||||
modifiedShapeData.setInitialPoint(newVertex1X, newVertex1Y);
|
||||
}
|
||||
currentCurveData.controlPoint1 =
|
||||
Offset(newVertex1OutPointX, newVertex1OutPointY);
|
||||
modifiedCurvesIndex++;
|
||||
|
||||
previousCurveData = currentCurveData;
|
||||
currentCurveData = modifiedCurves[modifiedCurvesIndex];
|
||||
previousCurveData.controlPoint2 =
|
||||
Offset(newVertex2InPointX, newVertex2InPointY);
|
||||
previousCurveData.vertex = Offset(newVertex2X, newVertex2Y);
|
||||
currentCurveData.controlPoint1 = Offset(newVertex2X, newVertex2Y);
|
||||
modifiedCurvesIndex++;
|
||||
} else {
|
||||
// This vertex is not a point. Don't modify it. Refer to the documentation above and for CubicCurveData for mapping a vertex
|
||||
// oriented point to CubicCurveData (path segments).
|
||||
var previousCurveData = modifiedCurves[
|
||||
floorMod(modifiedCurvesIndex - 1, modifiedCurves.length)];
|
||||
var currentCurveData = modifiedCurves[modifiedCurvesIndex];
|
||||
previousCurveData.controlPoint2 = Offset(
|
||||
previousCurve.controlPoint2.dx, previousCurve.controlPoint2.dy);
|
||||
previousCurveData.vertex =
|
||||
Offset(previousCurve.vertex.dx, previousCurve.vertex.dy);
|
||||
currentCurveData.controlPoint1 = Offset(
|
||||
startingCurve.controlPoint1.dx, startingCurve.controlPoint1.dy);
|
||||
modifiedCurvesIndex++;
|
||||
}
|
||||
}
|
||||
return modifiedShapeData;
|
||||
}
|
||||
|
||||
/// Returns a shape data with the correct number of vertices for the rounded corners shape.
|
||||
/// This just returns the object. It does not update any values within the shape.
|
||||
|
||||
ShapeData _getShapeData(ShapeData startingShapeData) {
|
||||
var startingCurves = startingShapeData.curves;
|
||||
var isClosed = startingShapeData.isClosed;
|
||||
var vertices = 0;
|
||||
for (var i = startingCurves.length - 1; i >= 0; i--) {
|
||||
var startingCurve = startingCurves[i];
|
||||
var previousCurve =
|
||||
startingCurves[floorMod(i - 1, startingCurves.length)];
|
||||
var vertex = (i == 0 && !isClosed)
|
||||
? startingShapeData.initialPoint
|
||||
: previousCurve.vertex;
|
||||
var inPoint =
|
||||
(i == 0 && !isClosed) ? vertex : previousCurve.controlPoint2;
|
||||
var outPoint = startingCurve.controlPoint1;
|
||||
|
||||
var isEndOfCurve = !startingShapeData.isClosed &&
|
||||
(i == 0 && i == startingCurves.length - 1);
|
||||
if (inPoint == vertex && outPoint == vertex && !isEndOfCurve) {
|
||||
vertices += 2;
|
||||
} else {
|
||||
vertices += 1;
|
||||
}
|
||||
}
|
||||
var shapeData = this.shapeData;
|
||||
if (shapeData == null || shapeData.curves.length != vertices) {
|
||||
var newCurves = <CubicCurveData>[];
|
||||
for (var i = 0; i < vertices; i++) {
|
||||
newCurves.add(CubicCurveData());
|
||||
}
|
||||
this.shapeData = shapeData =
|
||||
ShapeData(newCurves, initialPoint: Offset.zero, closed: false);
|
||||
}
|
||||
shapeData.setClosed(isClosed);
|
||||
return shapeData;
|
||||
}
|
||||
|
||||
/// Copied from the API 24+ AOSP source.
|
||||
static int floorMod(int x, int y) {
|
||||
return x - floorDiv(x, y) * y;
|
||||
}
|
||||
|
||||
/// Copied from the API 24+ AOSP source.
|
||||
static int floorDiv(int x, int y) {
|
||||
var r = x ~/ y;
|
||||
// if the signs are different and modulo not zero, round down
|
||||
if ((x ^ y) < 0 && (r * y != x)) {
|
||||
r--;
|
||||
}
|
||||
return r;
|
||||
}
|
||||
}
|
@ -5,10 +5,11 @@ import '../../model/content/shape_trim_path.dart';
|
||||
import '../../model/layer/base_layer.dart';
|
||||
import '../../utils.dart';
|
||||
import '../../utils/path_factory.dart';
|
||||
import '../keyframe/base_keyframe_animation.dart';
|
||||
import '../keyframe/shape_keyframe_animation.dart';
|
||||
import 'compound_trim_path_content.dart';
|
||||
import 'content.dart';
|
||||
import 'path_content.dart';
|
||||
import 'shape_modifier_content.dart';
|
||||
import 'trim_path_content.dart';
|
||||
|
||||
class ShapeContent implements PathContent {
|
||||
@ -17,7 +18,7 @@ class ShapeContent implements PathContent {
|
||||
final ShapePath _shape;
|
||||
|
||||
final LottieDrawable lottieDrawable;
|
||||
final BaseKeyframeAnimation<Object, Path> _shapeAnimation;
|
||||
final ShapeKeyframeAnimation _shapeAnimation;
|
||||
|
||||
bool _isPathValid = false;
|
||||
final _trimPaths = CompoundTrimPathContent();
|
||||
@ -35,6 +36,7 @@ class ShapeContent implements PathContent {
|
||||
|
||||
@override
|
||||
void setContents(List<Content> contentsBefore, List<Content> contentsAfter) {
|
||||
List<ShapeModifierContent>? shapeModifierContents;
|
||||
for (var i = 0; i < contentsBefore.length; i++) {
|
||||
var content = contentsBefore[i];
|
||||
if (content is TrimPathContent &&
|
||||
@ -43,8 +45,12 @@ class ShapeContent implements PathContent {
|
||||
var trimPath = content;
|
||||
_trimPaths.addTrimPath(trimPath);
|
||||
trimPath.addListener(_invalidate);
|
||||
} else if (content is ShapeModifierContent) {
|
||||
shapeModifierContents ??= [];
|
||||
shapeModifierContents.add(content);
|
||||
}
|
||||
}
|
||||
_shapeAnimation.setShapeModifiers(shapeModifierContents);
|
||||
}
|
||||
|
||||
@override
|
||||
|
6
lib/src/animation/content/shape_modifier_content.dart
Normal file
6
lib/src/animation/content/shape_modifier_content.dart
Normal file
@ -0,0 +1,6 @@
|
||||
import '../../model/content/shape_data.dart';
|
||||
import 'content.dart';
|
||||
|
||||
abstract class ShapeModifierContent extends Content {
|
||||
ShapeData modifyShape(ShapeData shapeData);
|
||||
}
|
@ -17,7 +17,7 @@ class StrokeContent extends BaseStrokeContent {
|
||||
BaseKeyframeAnimation<ColorFilter, ColorFilter?>? _colorFilterAnimation;
|
||||
|
||||
StrokeContent(
|
||||
final LottieDrawable lottieDrawable, BaseLayer layer, ShapeStroke stroke)
|
||||
LottieDrawable lottieDrawable, BaseLayer layer, ShapeStroke stroke)
|
||||
: name = stroke.name,
|
||||
_hidden = stroke.hidden,
|
||||
_colorAnimation = stroke.color.createAnimation(),
|
||||
|
@ -4,7 +4,7 @@ import '../../value/keyframe.dart';
|
||||
import 'keyframe_animation.dart';
|
||||
|
||||
class ColorKeyframeAnimation extends KeyframeAnimation<Color> {
|
||||
ColorKeyframeAnimation(List<Keyframe<Color>> keyframes) : super(keyframes);
|
||||
ColorKeyframeAnimation(super.keyframes);
|
||||
|
||||
@override
|
||||
Color getValue(Keyframe<Color> keyframe, double keyframeProgress) {
|
||||
|
@ -3,7 +3,7 @@ import '../../value/keyframe.dart';
|
||||
import 'keyframe_animation.dart';
|
||||
|
||||
class DoubleKeyframeAnimation extends KeyframeAnimation<double> {
|
||||
DoubleKeyframeAnimation(List<Keyframe<double>> keyframes) : super(keyframes);
|
||||
DoubleKeyframeAnimation(super.keyframes);
|
||||
|
||||
@override
|
||||
double getValue(Keyframe<double> keyframe, double keyframeProgress) {
|
||||
|
@ -10,7 +10,7 @@ import 'base_keyframe_animation.dart';
|
||||
import 'color_keyframe_animation.dart';
|
||||
|
||||
class DropShadowKeyframeAnimation {
|
||||
static final double _degToRad = math.pi / 180.0;
|
||||
static const double _degToRad = math.pi / 180.0;
|
||||
|
||||
final void Function() listener;
|
||||
late final ColorKeyframeAnimation _color;
|
||||
|
@ -3,7 +3,7 @@ import '../../value/keyframe.dart';
|
||||
import 'keyframe_animation.dart';
|
||||
|
||||
class IntegerKeyframeAnimation extends KeyframeAnimation<int> {
|
||||
IntegerKeyframeAnimation(List<Keyframe<int>> keyframes) : super(keyframes);
|
||||
IntegerKeyframeAnimation(super.keyframes);
|
||||
|
||||
@override
|
||||
int getValue(Keyframe<int> keyframe, double keyframeProgress) {
|
||||
|
@ -1,7 +1,6 @@
|
||||
import '../../value/keyframe.dart';
|
||||
import 'base_keyframe_animation.dart';
|
||||
|
||||
abstract class KeyframeAnimation<T extends Object>
|
||||
extends BaseKeyframeAnimation<T, T> {
|
||||
KeyframeAnimation(List<Keyframe<T>> keyframes) : super(keyframes);
|
||||
KeyframeAnimation(super.keyframes);
|
||||
}
|
||||
|
@ -7,9 +7,9 @@ class PathKeyframe extends Keyframe<Offset> {
|
||||
Path? _path;
|
||||
final Keyframe<Offset> _pointKeyFrame;
|
||||
|
||||
PathKeyframe(LottieComposition composition, Keyframe<Offset> keyframe)
|
||||
PathKeyframe(LottieComposition super.composition, Keyframe<Offset> keyframe)
|
||||
: _pointKeyFrame = keyframe,
|
||||
super(composition,
|
||||
super(
|
||||
startValue: keyframe.startValue,
|
||||
endValue: keyframe.endValue,
|
||||
interpolator: keyframe.interpolator,
|
||||
|
@ -7,7 +7,7 @@ class PathKeyframeAnimation extends KeyframeAnimation<Offset> {
|
||||
PathKeyframe? _pathMeasureKeyframe;
|
||||
late PathMetric _pathMeasure;
|
||||
|
||||
PathKeyframeAnimation(List<Keyframe<Offset>> keyframes) : super(keyframes);
|
||||
PathKeyframeAnimation(super.keyframes);
|
||||
|
||||
@override
|
||||
Offset getValue(Keyframe<Offset> keyframe, double keyframeProgress) {
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user