mirror of
https://github.com/rive-app/rive-flutter.git
synced 2025-08-06 16:40:27 +08:00
Xxxx hidden paths runtime render fixes solos
This PR adds support for soloing individual paths and nested shapes. It also aligns editor and runtime behavior. Diffs= ee674a819 Xxxx hidden paths runtime render fixes solos (#6252) a0f076e31 tendon crash fix (#6258) fdad66136 Disable d3d blend state during PLS flush (#6254) e717ed98a add clipResult enum and render clips to copy the editor behavior (#6218) faba3ff51 Unity (#6173) 18ae32102 Delete assets after artboards to fix race condition with FileAssetReferencers. (#6223) 252100f48 Fix validation for listeners to validate with nested inputs (#6220) f21ebc98c compute parameters when cubic values change (#6207) Co-authored-by: hernan <hernan@rive.app>
This commit is contained in:
@ -1 +1 @@
|
|||||||
da903372b918a5ad3f86439a944b9dddb8c5a785
|
ee674a819b3e4af245cb5b33bc60bab2741079ce
|
||||||
|
@ -309,6 +309,15 @@ abstract class Path extends PathBase {
|
|||||||
void pathFlagsChanged(int from, int to) => markPathDirty();
|
void pathFlagsChanged(int from, int to) => markPathDirty();
|
||||||
|
|
||||||
bool get isHidden => (pathFlags & ComponentFlags.hidden) != 0;
|
bool get isHidden => (pathFlags & ComponentFlags.hidden) != 0;
|
||||||
|
|
||||||
|
@override
|
||||||
|
bool propagateCollapse(bool collapse) {
|
||||||
|
bool changed = super.propagateCollapse(collapse);
|
||||||
|
if (changed && shape != null) {
|
||||||
|
shape!.pathCollapseChanged();
|
||||||
|
}
|
||||||
|
return changed;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
enum _PathCommand { moveTo, lineTo, cubicTo, close }
|
enum _PathCommand { moveTo, lineTo, cubicTo, close }
|
||||||
|
@ -37,7 +37,7 @@ class PathComposer extends Component {
|
|||||||
Mat2D inverseWorld = Mat2D();
|
Mat2D inverseWorld = Mat2D();
|
||||||
if (Mat2D.invert(inverseWorld, world)) {
|
if (Mat2D.invert(inverseWorld, world)) {
|
||||||
for (final path in shape.paths) {
|
for (final path in shape.paths) {
|
||||||
if (path.isHidden) {
|
if (path.isHidden || path.isCollapsed) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
localPath.addPath(path.uiPath, ui.Offset.zero,
|
localPath.addPath(path.uiPath, ui.Offset.zero,
|
||||||
@ -56,7 +56,7 @@ class PathComposer extends Component {
|
|||||||
if (buildWorldPath) {
|
if (buildWorldPath) {
|
||||||
worldPath.reset();
|
worldPath.reset();
|
||||||
for (final path in shape.paths) {
|
for (final path in shape.paths) {
|
||||||
if (path.isHidden) {
|
if (path.isHidden || path.isCollapsed) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
worldPath.addPath(path.uiPath, ui.Offset.zero,
|
worldPath.addPath(path.uiPath, ui.Offset.zero,
|
||||||
@ -99,4 +99,19 @@ class PathComposer extends Component {
|
|||||||
onDirty(dirt);
|
onDirty(dirt);
|
||||||
artboard?.onComponentDirty(this);
|
artboard?.onComponentDirty(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Instead of adding dirt and rely on the recursive behavior of the addDirt method,
|
||||||
|
// we need to explicitly add dirt to the dependents. The reason is that a collapsed
|
||||||
|
// shape will not clear its dirty path flag in the current frame since it is collapsed.
|
||||||
|
// So in a future frame if it is uncollapsed, we mark its path flag as dirty again,
|
||||||
|
// but since it was already dirty, the recursive part will not kick in and the dependents
|
||||||
|
// won't update.
|
||||||
|
// This scenario is not common, but it can happen when a solo toggles between an empty
|
||||||
|
// group and a path for example.
|
||||||
|
void pathCollapseChanged() {
|
||||||
|
addDirt(ComponentDirt.path);
|
||||||
|
for (final d in dependents) {
|
||||||
|
d.addDirt(ComponentDirt.path, recurse: true);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -72,6 +72,8 @@ class Shape extends ShapeBase with ShapePaintContainer {
|
|||||||
|
|
||||||
void pathChanged(Path path) => _markComposerDirty();
|
void pathChanged(Path path) => _markComposerDirty();
|
||||||
|
|
||||||
|
void pathCollapseChanged() => pathComposer.pathCollapseChanged();
|
||||||
|
|
||||||
void paintChanged() {
|
void paintChanged() {
|
||||||
addDirt(ComponentDirt.path);
|
addDirt(ComponentDirt.path);
|
||||||
_markBlendModeDirty();
|
_markBlendModeDirty();
|
||||||
@ -314,4 +316,10 @@ class Shape extends ShapeBase with ShapePaintContainer {
|
|||||||
path.buildPath(hitTester);
|
path.buildPath(hitTester);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
bool propagateCollapse(bool collapse) {
|
||||||
|
propagateCollapseToChildren(collapse);
|
||||||
|
return super.propagateCollapse(collapse);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user