diff --git a/lib/src/rive_core/animation/keyframe_draw_order_value.dart b/lib/src/rive_core/animation/keyframe_draw_order_value.dart index da7fc9a..06a5241 100644 --- a/lib/src/rive_core/animation/keyframe_draw_order_value.dart +++ b/lib/src/rive_core/animation/keyframe_draw_order_value.dart @@ -19,9 +19,4 @@ class KeyFrameDrawOrderValue extends KeyFrameDrawOrderValueBase { drawable.drawOrder = value; } } - - int runtimeValueValue(int editorValue) { - assert(false, 'this should never get called'); - return 0; - } } diff --git a/lib/src/rive_core/bounds_delegate.dart b/lib/src/rive_core/bounds_delegate.dart deleted file mode 100644 index fde94ed..0000000 --- a/lib/src/rive_core/bounds_delegate.dart +++ /dev/null @@ -1,4 +0,0 @@ -// ignore: one_member_abstracts -abstract class BoundsDelegate { - void boundsChanged(); -} diff --git a/lib/src/rive_core/node.dart b/lib/src/rive_core/node.dart index afd195e..f65a258 100644 --- a/lib/src/rive_core/node.dart +++ b/lib/src/rive_core/node.dart @@ -1,5 +1,4 @@ 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/container_component.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 { final Mat2D transform = Mat2D(); final Mat2D worldTransform = Mat2D(); - BoundsDelegate _delegate; double _renderOpacity = 0; double get renderOpacity => _renderOpacity; @override @@ -60,16 +58,6 @@ class Node extends NodeBase { } else { Mat2D.copy(worldTransform, transform); } - _delegate?.boundsChanged(); - } - - @override - void userDataChanged(dynamic from, dynamic to) { - if (to is BoundsDelegate) { - _delegate = to; - } else { - _delegate = null; - } } void calculateWorldTransform() { diff --git a/lib/src/rive_core/shapes/cubic_asymmetric_vertex.dart b/lib/src/rive_core/shapes/cubic_asymmetric_vertex.dart index e377105..bad8694 100644 --- a/lib/src/rive_core/shapes/cubic_asymmetric_vertex.dart +++ b/lib/src/rive_core/shapes/cubic_asymmetric_vertex.dart @@ -16,6 +16,11 @@ class CubicAsymmetricVertex extends CubicAsymmetricVertexBase { cos(rotation) * outDistance, sin(rotation) * outDistance)); } + @override + set outPoint(Vec2D value) { + _outPoint = Vec2D.clone(value); + } + @override Vec2D get inPoint { return _inPoint ??= Vec2D.add( @@ -25,6 +30,11 @@ class CubicAsymmetricVertex extends CubicAsymmetricVertexBase { cos(rotation) * -inDistance, sin(rotation) * -inDistance)); } + @override + set inPoint(Vec2D value) { + _inPoint = Vec2D.clone(value); + } + @override String toString() { return 'in ${inPoint[0]}, ${inPoint[1]} | ${translation.toString()} ' diff --git a/lib/src/rive_core/shapes/cubic_detached_vertex.dart b/lib/src/rive_core/shapes/cubic_detached_vertex.dart index 79dd88e..63e4189 100644 --- a/lib/src/rive_core/shapes/cubic_detached_vertex.dart +++ b/lib/src/rive_core/shapes/cubic_detached_vertex.dart @@ -28,6 +28,7 @@ class CubicDetachedVertex extends CubicDetachedVertexBase { translation, Vec2D.fromValues( cos(outRotation) * outDistance, sin(outRotation) * outDistance)); + @override set outPoint(Vec2D value) { _outPoint = Vec2D.clone(value); } @@ -38,6 +39,7 @@ class CubicDetachedVertex extends CubicDetachedVertexBase { translation, Vec2D.fromValues( cos(inRotation) * inDistance, sin(inRotation) * inDistance)); + @override set inPoint(Vec2D value) { _inPoint = Vec2D.clone(value); } diff --git a/lib/src/rive_core/shapes/cubic_mirrored_vertex.dart b/lib/src/rive_core/shapes/cubic_mirrored_vertex.dart index 1899835..d03e9fb 100644 --- a/lib/src/rive_core/shapes/cubic_mirrored_vertex.dart +++ b/lib/src/rive_core/shapes/cubic_mirrored_vertex.dart @@ -13,12 +13,23 @@ class CubicMirroredVertex extends CubicMirroredVertexBase { Vec2D.fromValues(cos(rotation) * distance, sin(rotation) * distance)); } + @override + set outPoint(Vec2D value) { + _outPoint = Vec2D.clone(value); + } + @override Vec2D get inPoint { return _inPoint ??= Vec2D.add(Vec2D(), translation, 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 String toString() { return 'in ${inPoint[0]}, ${inPoint[1]} | ${translation.toString()} ' diff --git a/lib/src/rive_core/shapes/cubic_vertex.dart b/lib/src/rive_core/shapes/cubic_vertex.dart index 2ea5b38..a52e95f 100644 --- a/lib/src/rive_core/shapes/cubic_vertex.dart +++ b/lib/src/rive_core/shapes/cubic_vertex.dart @@ -4,4 +4,6 @@ import 'package:rive/src/generated/shapes/cubic_vertex_base.dart'; abstract class CubicVertex extends CubicVertexBase { Vec2D get outPoint; Vec2D get inPoint; + set outPoint(Vec2D value); + set inPoint(Vec2D value); } diff --git a/lib/src/rive_core/shapes/paint/gradient_stop.dart b/lib/src/rive_core/shapes/paint/gradient_stop.dart index 4d372c2..4c543a4 100644 --- a/lib/src/rive_core/shapes/paint/gradient_stop.dart +++ b/lib/src/rive_core/shapes/paint/gradient_stop.dart @@ -1,15 +1,10 @@ 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/generated/shapes/paint/gradient_stop_base.dart'; import 'package:rive/src/rive_core/shapes/paint/linear_gradient.dart'; export 'package:rive/src/generated/shapes/paint/gradient_stop_base.dart'; 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 get gradient => _gradient; ui.Color get color => ui.Color(colorValue); diff --git a/lib/src/rive_core/shapes/paint/linear_gradient.dart b/lib/src/rive_core/shapes/paint/linear_gradient.dart index 140dc95..b518d7d 100644 --- a/lib/src/rive_core/shapes/paint/linear_gradient.dart +++ b/lib/src/rive_core/shapes/paint/linear_gradient.dart @@ -10,7 +10,6 @@ export 'package:rive/src/generated/shapes/paint/linear_gradient_base.dart'; class LinearGradient extends LinearGradientBase with ShapePaintMutator { final List gradientStops = []; - Component get timelineProxy => parent; bool _paintsInWorldSpace = true; bool get paintsInWorldSpace => _paintsInWorldSpace; set paintsInWorldSpace(bool value) { diff --git a/lib/src/rive_core/shapes/paint/shape_paint.dart b/lib/src/rive_core/shapes/paint/shape_paint.dart index 9966e77..e17b0ed 100644 --- a/lib/src/rive_core/shapes/paint/shape_paint.dart +++ b/lib/src/rive_core/shapes/paint/shape_paint.dart @@ -21,7 +21,6 @@ abstract class ShapePaint extends ShapePaintBase { set blendMode(BlendMode value) => _paint.blendMode = value; double get renderOpacity => _paintMutator.renderOpacity; set renderOpacity(double value) => _paintMutator.renderOpacity = value; - Component get timelineParent => _shapePaintContainer as Component; ShapePaintMutator get paintMutator => _paintMutator; void _changeMutator(ShapePaintMutator mutator) { _paint = makePaint(); diff --git a/lib/src/rive_core/shapes/paint/solid_color.dart b/lib/src/rive_core/shapes/paint/solid_color.dart index 6b3c315..3d8b3c3 100644 --- a/lib/src/rive_core/shapes/paint/solid_color.dart +++ b/lib/src/rive_core/shapes/paint/solid_color.dart @@ -1,5 +1,4 @@ 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/shapes/paint/shape_paint_mutator.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'; class SolidColor extends SolidColorBase with ShapePaintMutator { - Component get timelineProxy => parent; Color get color => Color(colorValue); set color(Color c) { colorValue = c.value; diff --git a/lib/src/rive_core/shapes/paint/stroke.dart b/lib/src/rive_core/shapes/paint/stroke.dart index 83c75a5..fe65130 100644 --- a/lib/src/rive_core/shapes/paint/stroke.dart +++ b/lib/src/rive_core/shapes/paint/stroke.dart @@ -11,7 +11,6 @@ class Stroke extends StrokeBase { ..strokeCap = strokeCap ..strokeJoin = strokeJoin ..strokeWidth = thickness; - String get timelineParentGroup => 'strokes'; StrokeCap get strokeCap => StrokeCap.values[cap]; set strokeCap(StrokeCap value) => cap = value.index; StrokeJoin get strokeJoin => StrokeJoin.values[join]; diff --git a/lib/src/rive_core/shapes/path.dart b/lib/src/rive_core/shapes/path.dart index 31ae031..b507885 100644 --- a/lib/src/rive_core/shapes/path.dart +++ b/lib/src/rive_core/shapes/path.dart @@ -1,6 +1,5 @@ import 'dart:math'; 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_dirt.dart'; import 'package:rive/src/rive_core/math/aabb.dart'; @@ -31,27 +30,12 @@ abstract class Path extends PathBase { Mat2D get pathTransform; Mat2D get inversePathTransform; Mat2D get inverseWorldTransform => _inverseWorldTransform; - Component get timelineParent => _shape; @override bool resolveArtboard() { _changeShape(null); 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 void visitAncestor(Component ancestor) { if (_shape == null && ancestor is Shape) { diff --git a/lib/src/rive_core/shapes/render_cubic_vertex.dart b/lib/src/rive_core/shapes/render_cubic_vertex.dart index 4b4ab7a..64451ed 100644 --- a/lib/src/rive_core/shapes/render_cubic_vertex.dart +++ b/lib/src/rive_core/shapes/render_cubic_vertex.dart @@ -1,16 +1,11 @@ -import 'dart:collection'; import 'package:rive/src/rive_core/math/vec2d.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 { - void changeNonNull() {} @override Vec2D inPoint; @override Vec2D outPoint; @override void onAddedDirty() {} - void writeRuntimeProperties( - BinaryWriter writer, HashMap idLookup) {} } diff --git a/lib/src/rive_core/shapes/shape.dart b/lib/src/rive_core/shapes/shape.dart index 4abb181..9536f6c 100644 --- a/lib/src/rive_core/shapes/shape.dart +++ b/lib/src/rive_core/shapes/shape.dart @@ -1,5 +1,4 @@ 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_dirt.dart'; import 'package:rive/src/rive_core/math/aabb.dart'; @@ -34,17 +33,12 @@ class Shape extends ShapeBase with ShapePaintContainer { AABB _worldBounds; AABB _localBounds; - BoundsDelegate _delegate; @override AABB get worldBounds => _worldBounds ??= computeWorldBounds(); @override AABB get localBounds => _localBounds ??= computeLocalBounds(); void markBoundsDirty() { _worldBounds = _localBounds = null; - _delegate?.boundsChanged(); - for (final path in paths) { - path.markBoundsDirty(); - } } @override @@ -202,15 +196,6 @@ class Shape extends ShapeBase with ShapePaintContainer { return localBounds; } - @override - void userDataChanged(dynamic from, dynamic to) { - if (to is BoundsDelegate) { - _delegate = to; - } else { - _delegate = null; - } - } - @override void blendModeValueChanged(int from, int to) => _markBlendModeDirty(); @override