mirror of
https://github.com/rive-app/rive-flutter.git
synced 2025-06-27 18:28:18 +08:00
Regenerated cleaned up code that happily runs through flutter analyze.
This commit is contained in:
@ -19,9 +19,4 @@ class KeyFrameDrawOrderValue extends KeyFrameDrawOrderValueBase {
|
|||||||
drawable.drawOrder = value;
|
drawable.drawOrder = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int runtimeValueValue(int editorValue) {
|
|
||||||
assert(false, 'this should never get called');
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -1,4 +0,0 @@
|
|||||||
// ignore: one_member_abstracts
|
|
||||||
abstract class BoundsDelegate {
|
|
||||||
void boundsChanged();
|
|
||||||
}
|
|
@ -1,5 +1,4 @@
|
|||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:rive/src/rive_core/bounds_delegate.dart';
|
|
||||||
import 'package:rive/src/rive_core/component_dirt.dart';
|
import 'package:rive/src/rive_core/component_dirt.dart';
|
||||||
import 'package:rive/src/rive_core/container_component.dart';
|
import 'package:rive/src/rive_core/container_component.dart';
|
||||||
import 'package:rive/src/rive_core/math/mat2d.dart';
|
import 'package:rive/src/rive_core/math/mat2d.dart';
|
||||||
@ -11,7 +10,6 @@ export 'package:rive/src/generated/node_base.dart';
|
|||||||
class Node extends NodeBase {
|
class Node extends NodeBase {
|
||||||
final Mat2D transform = Mat2D();
|
final Mat2D transform = Mat2D();
|
||||||
final Mat2D worldTransform = Mat2D();
|
final Mat2D worldTransform = Mat2D();
|
||||||
BoundsDelegate _delegate;
|
|
||||||
double _renderOpacity = 0;
|
double _renderOpacity = 0;
|
||||||
double get renderOpacity => _renderOpacity;
|
double get renderOpacity => _renderOpacity;
|
||||||
@override
|
@override
|
||||||
@ -60,16 +58,6 @@ class Node extends NodeBase {
|
|||||||
} else {
|
} else {
|
||||||
Mat2D.copy(worldTransform, transform);
|
Mat2D.copy(worldTransform, transform);
|
||||||
}
|
}
|
||||||
_delegate?.boundsChanged();
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
void userDataChanged(dynamic from, dynamic to) {
|
|
||||||
if (to is BoundsDelegate) {
|
|
||||||
_delegate = to;
|
|
||||||
} else {
|
|
||||||
_delegate = null;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void calculateWorldTransform() {
|
void calculateWorldTransform() {
|
||||||
|
@ -16,6 +16,11 @@ class CubicAsymmetricVertex extends CubicAsymmetricVertexBase {
|
|||||||
cos(rotation) * outDistance, sin(rotation) * outDistance));
|
cos(rotation) * outDistance, sin(rotation) * outDistance));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
set outPoint(Vec2D value) {
|
||||||
|
_outPoint = Vec2D.clone(value);
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Vec2D get inPoint {
|
Vec2D get inPoint {
|
||||||
return _inPoint ??= Vec2D.add(
|
return _inPoint ??= Vec2D.add(
|
||||||
@ -25,6 +30,11 @@ class CubicAsymmetricVertex extends CubicAsymmetricVertexBase {
|
|||||||
cos(rotation) * -inDistance, sin(rotation) * -inDistance));
|
cos(rotation) * -inDistance, sin(rotation) * -inDistance));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
set inPoint(Vec2D value) {
|
||||||
|
_inPoint = Vec2D.clone(value);
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String toString() {
|
String toString() {
|
||||||
return 'in ${inPoint[0]}, ${inPoint[1]} | ${translation.toString()} '
|
return 'in ${inPoint[0]}, ${inPoint[1]} | ${translation.toString()} '
|
||||||
|
@ -28,6 +28,7 @@ class CubicDetachedVertex extends CubicDetachedVertexBase {
|
|||||||
translation,
|
translation,
|
||||||
Vec2D.fromValues(
|
Vec2D.fromValues(
|
||||||
cos(outRotation) * outDistance, sin(outRotation) * outDistance));
|
cos(outRotation) * outDistance, sin(outRotation) * outDistance));
|
||||||
|
@override
|
||||||
set outPoint(Vec2D value) {
|
set outPoint(Vec2D value) {
|
||||||
_outPoint = Vec2D.clone(value);
|
_outPoint = Vec2D.clone(value);
|
||||||
}
|
}
|
||||||
@ -38,6 +39,7 @@ class CubicDetachedVertex extends CubicDetachedVertexBase {
|
|||||||
translation,
|
translation,
|
||||||
Vec2D.fromValues(
|
Vec2D.fromValues(
|
||||||
cos(inRotation) * inDistance, sin(inRotation) * inDistance));
|
cos(inRotation) * inDistance, sin(inRotation) * inDistance));
|
||||||
|
@override
|
||||||
set inPoint(Vec2D value) {
|
set inPoint(Vec2D value) {
|
||||||
_inPoint = Vec2D.clone(value);
|
_inPoint = Vec2D.clone(value);
|
||||||
}
|
}
|
||||||
|
@ -13,12 +13,23 @@ class CubicMirroredVertex extends CubicMirroredVertexBase {
|
|||||||
Vec2D.fromValues(cos(rotation) * distance, sin(rotation) * distance));
|
Vec2D.fromValues(cos(rotation) * distance, sin(rotation) * distance));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
set outPoint(Vec2D value) {
|
||||||
|
_outPoint = Vec2D.clone(value);
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Vec2D get inPoint {
|
Vec2D get inPoint {
|
||||||
return _inPoint ??= Vec2D.add(Vec2D(), translation,
|
return _inPoint ??= Vec2D.add(Vec2D(), translation,
|
||||||
Vec2D.fromValues(cos(rotation) * -distance, sin(rotation) * -distance));
|
Vec2D.fromValues(cos(rotation) * -distance, sin(rotation) * -distance));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
set inPoint(Vec2D value) {
|
||||||
|
var diffIn = Vec2D.fromValues(value[0] - x, value[1] - y);
|
||||||
|
outPoint = Vec2D.subtract(Vec2D(), translation, diffIn);
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String toString() {
|
String toString() {
|
||||||
return 'in ${inPoint[0]}, ${inPoint[1]} | ${translation.toString()} '
|
return 'in ${inPoint[0]}, ${inPoint[1]} | ${translation.toString()} '
|
||||||
|
@ -4,4 +4,6 @@ import 'package:rive/src/generated/shapes/cubic_vertex_base.dart';
|
|||||||
abstract class CubicVertex extends CubicVertexBase {
|
abstract class CubicVertex extends CubicVertexBase {
|
||||||
Vec2D get outPoint;
|
Vec2D get outPoint;
|
||||||
Vec2D get inPoint;
|
Vec2D get inPoint;
|
||||||
|
set outPoint(Vec2D value);
|
||||||
|
set inPoint(Vec2D value);
|
||||||
}
|
}
|
||||||
|
@ -1,15 +1,10 @@
|
|||||||
import 'dart:ui' as ui;
|
import 'dart:ui' as ui;
|
||||||
import 'package:rive/src/rive_core/component.dart';
|
|
||||||
import 'package:rive/src/rive_core/container_component.dart';
|
import 'package:rive/src/rive_core/container_component.dart';
|
||||||
import 'package:rive/src/generated/shapes/paint/gradient_stop_base.dart';
|
import 'package:rive/src/generated/shapes/paint/gradient_stop_base.dart';
|
||||||
import 'package:rive/src/rive_core/shapes/paint/linear_gradient.dart';
|
import 'package:rive/src/rive_core/shapes/paint/linear_gradient.dart';
|
||||||
export 'package:rive/src/generated/shapes/paint/gradient_stop_base.dart';
|
export 'package:rive/src/generated/shapes/paint/gradient_stop_base.dart';
|
||||||
|
|
||||||
class GradientStop extends GradientStopBase {
|
class GradientStop extends GradientStopBase {
|
||||||
Component get timelineParent =>
|
|
||||||
_gradient is LinearGradient ? _gradient.parent : null;
|
|
||||||
String get timelineName =>
|
|
||||||
'Stop ${_gradient.gradientStops.indexOf(this) + 1}';
|
|
||||||
LinearGradient _gradient;
|
LinearGradient _gradient;
|
||||||
LinearGradient get gradient => _gradient;
|
LinearGradient get gradient => _gradient;
|
||||||
ui.Color get color => ui.Color(colorValue);
|
ui.Color get color => ui.Color(colorValue);
|
||||||
|
@ -10,7 +10,6 @@ export 'package:rive/src/generated/shapes/paint/linear_gradient_base.dart';
|
|||||||
|
|
||||||
class LinearGradient extends LinearGradientBase with ShapePaintMutator {
|
class LinearGradient extends LinearGradientBase with ShapePaintMutator {
|
||||||
final List<GradientStop> gradientStops = [];
|
final List<GradientStop> gradientStops = [];
|
||||||
Component get timelineProxy => parent;
|
|
||||||
bool _paintsInWorldSpace = true;
|
bool _paintsInWorldSpace = true;
|
||||||
bool get paintsInWorldSpace => _paintsInWorldSpace;
|
bool get paintsInWorldSpace => _paintsInWorldSpace;
|
||||||
set paintsInWorldSpace(bool value) {
|
set paintsInWorldSpace(bool value) {
|
||||||
|
@ -21,7 +21,6 @@ abstract class ShapePaint extends ShapePaintBase {
|
|||||||
set blendMode(BlendMode value) => _paint.blendMode = value;
|
set blendMode(BlendMode value) => _paint.blendMode = value;
|
||||||
double get renderOpacity => _paintMutator.renderOpacity;
|
double get renderOpacity => _paintMutator.renderOpacity;
|
||||||
set renderOpacity(double value) => _paintMutator.renderOpacity = value;
|
set renderOpacity(double value) => _paintMutator.renderOpacity = value;
|
||||||
Component get timelineParent => _shapePaintContainer as Component;
|
|
||||||
ShapePaintMutator get paintMutator => _paintMutator;
|
ShapePaintMutator get paintMutator => _paintMutator;
|
||||||
void _changeMutator(ShapePaintMutator mutator) {
|
void _changeMutator(ShapePaintMutator mutator) {
|
||||||
_paint = makePaint();
|
_paint = makePaint();
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import 'dart:ui';
|
import 'dart:ui';
|
||||||
import 'package:rive/src/rive_core/component.dart';
|
|
||||||
import 'package:rive/src/rive_core/component_dirt.dart';
|
import 'package:rive/src/rive_core/component_dirt.dart';
|
||||||
import 'package:rive/src/rive_core/shapes/paint/shape_paint_mutator.dart';
|
import 'package:rive/src/rive_core/shapes/paint/shape_paint_mutator.dart';
|
||||||
import 'package:rive/src/rive_core/shapes/shape_paint_container.dart';
|
import 'package:rive/src/rive_core/shapes/shape_paint_container.dart';
|
||||||
@ -7,7 +6,6 @@ import 'package:rive/src/generated/shapes/paint/solid_color_base.dart';
|
|||||||
export 'package:rive/src/generated/shapes/paint/solid_color_base.dart';
|
export 'package:rive/src/generated/shapes/paint/solid_color_base.dart';
|
||||||
|
|
||||||
class SolidColor extends SolidColorBase with ShapePaintMutator {
|
class SolidColor extends SolidColorBase with ShapePaintMutator {
|
||||||
Component get timelineProxy => parent;
|
|
||||||
Color get color => Color(colorValue);
|
Color get color => Color(colorValue);
|
||||||
set color(Color c) {
|
set color(Color c) {
|
||||||
colorValue = c.value;
|
colorValue = c.value;
|
||||||
|
@ -11,7 +11,6 @@ class Stroke extends StrokeBase {
|
|||||||
..strokeCap = strokeCap
|
..strokeCap = strokeCap
|
||||||
..strokeJoin = strokeJoin
|
..strokeJoin = strokeJoin
|
||||||
..strokeWidth = thickness;
|
..strokeWidth = thickness;
|
||||||
String get timelineParentGroup => 'strokes';
|
|
||||||
StrokeCap get strokeCap => StrokeCap.values[cap];
|
StrokeCap get strokeCap => StrokeCap.values[cap];
|
||||||
set strokeCap(StrokeCap value) => cap = value.index;
|
set strokeCap(StrokeCap value) => cap = value.index;
|
||||||
StrokeJoin get strokeJoin => StrokeJoin.values[join];
|
StrokeJoin get strokeJoin => StrokeJoin.values[join];
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
import 'dart:math';
|
import 'dart:math';
|
||||||
import 'dart:ui' as ui;
|
import 'dart:ui' as ui;
|
||||||
import 'package:rive/src/rive_core/bounds_delegate.dart';
|
|
||||||
import 'package:rive/src/rive_core/component.dart';
|
import 'package:rive/src/rive_core/component.dart';
|
||||||
import 'package:rive/src/rive_core/component_dirt.dart';
|
import 'package:rive/src/rive_core/component_dirt.dart';
|
||||||
import 'package:rive/src/rive_core/math/aabb.dart';
|
import 'package:rive/src/rive_core/math/aabb.dart';
|
||||||
@ -31,27 +30,12 @@ abstract class Path extends PathBase {
|
|||||||
Mat2D get pathTransform;
|
Mat2D get pathTransform;
|
||||||
Mat2D get inversePathTransform;
|
Mat2D get inversePathTransform;
|
||||||
Mat2D get inverseWorldTransform => _inverseWorldTransform;
|
Mat2D get inverseWorldTransform => _inverseWorldTransform;
|
||||||
Component get timelineParent => _shape;
|
|
||||||
@override
|
@override
|
||||||
bool resolveArtboard() {
|
bool resolveArtboard() {
|
||||||
_changeShape(null);
|
_changeShape(null);
|
||||||
return super.resolveArtboard();
|
return super.resolveArtboard();
|
||||||
}
|
}
|
||||||
|
|
||||||
BoundsDelegate _delegate;
|
|
||||||
void markBoundsDirty() {
|
|
||||||
_delegate?.boundsChanged();
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
void userDataChanged(dynamic from, dynamic to) {
|
|
||||||
if (to is BoundsDelegate) {
|
|
||||||
_delegate = to;
|
|
||||||
} else {
|
|
||||||
_delegate = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void visitAncestor(Component ancestor) {
|
void visitAncestor(Component ancestor) {
|
||||||
if (_shape == null && ancestor is Shape) {
|
if (_shape == null && ancestor is Shape) {
|
||||||
|
@ -1,16 +1,11 @@
|
|||||||
import 'dart:collection';
|
|
||||||
import 'package:rive/src/rive_core/math/vec2d.dart';
|
import 'package:rive/src/rive_core/math/vec2d.dart';
|
||||||
import 'package:rive/src/rive_core/shapes/cubic_vertex.dart';
|
import 'package:rive/src/rive_core/shapes/cubic_vertex.dart';
|
||||||
import 'package:rive/src/utilities/binary_buffer/binary_writer.dart';
|
|
||||||
|
|
||||||
class RenderCubicVertex extends CubicVertex {
|
class RenderCubicVertex extends CubicVertex {
|
||||||
void changeNonNull() {}
|
|
||||||
@override
|
@override
|
||||||
Vec2D inPoint;
|
Vec2D inPoint;
|
||||||
@override
|
@override
|
||||||
Vec2D outPoint;
|
Vec2D outPoint;
|
||||||
@override
|
@override
|
||||||
void onAddedDirty() {}
|
void onAddedDirty() {}
|
||||||
void writeRuntimeProperties(
|
|
||||||
BinaryWriter writer, HashMap<int, int> idLookup) {}
|
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import 'dart:ui';
|
import 'dart:ui';
|
||||||
import 'package:rive/src/rive_core/bounds_delegate.dart';
|
|
||||||
import 'package:rive/src/rive_core/component.dart';
|
import 'package:rive/src/rive_core/component.dart';
|
||||||
import 'package:rive/src/rive_core/component_dirt.dart';
|
import 'package:rive/src/rive_core/component_dirt.dart';
|
||||||
import 'package:rive/src/rive_core/math/aabb.dart';
|
import 'package:rive/src/rive_core/math/aabb.dart';
|
||||||
@ -34,17 +33,12 @@ class Shape extends ShapeBase with ShapePaintContainer {
|
|||||||
|
|
||||||
AABB _worldBounds;
|
AABB _worldBounds;
|
||||||
AABB _localBounds;
|
AABB _localBounds;
|
||||||
BoundsDelegate _delegate;
|
|
||||||
@override
|
@override
|
||||||
AABB get worldBounds => _worldBounds ??= computeWorldBounds();
|
AABB get worldBounds => _worldBounds ??= computeWorldBounds();
|
||||||
@override
|
@override
|
||||||
AABB get localBounds => _localBounds ??= computeLocalBounds();
|
AABB get localBounds => _localBounds ??= computeLocalBounds();
|
||||||
void markBoundsDirty() {
|
void markBoundsDirty() {
|
||||||
_worldBounds = _localBounds = null;
|
_worldBounds = _localBounds = null;
|
||||||
_delegate?.boundsChanged();
|
|
||||||
for (final path in paths) {
|
|
||||||
path.markBoundsDirty();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -202,15 +196,6 @@ class Shape extends ShapeBase with ShapePaintContainer {
|
|||||||
return localBounds;
|
return localBounds;
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
|
||||||
void userDataChanged(dynamic from, dynamic to) {
|
|
||||||
if (to is BoundsDelegate) {
|
|
||||||
_delegate = to;
|
|
||||||
} else {
|
|
||||||
_delegate = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void blendModeValueChanged(int from, int to) => _markBlendModeDirty();
|
void blendModeValueChanged(int from, int to) => _markBlendModeDirty();
|
||||||
@override
|
@override
|
||||||
|
Reference in New Issue
Block a user