protected override void EndEditingInternal(bool pathJustCreated) { PathGeometry pathGeometry1 = PathGeometryUtilities.Copy(this.PathGeometry, false); bool isAnimated = this.IsAnimated; if (!isAnimated && this.ViewModel.AnimationEditor.IsKeyFraming) { System.Windows.Media.Geometry geometry1 = (System.Windows.Media.Geometry) this.editingElement.GetComputedValueAsWpf(Base2DElement.ClipProperty); PathGeometry geometry2 = new PathGeometry(); if (geometry1 != null) { geometry2.AddGeometry(geometry1); } PathGeometryUtilities.EnsureOnlySingleSegmentsInGeometry(geometry2); SceneNode sceneNode = this.editingElement.ViewModel.CreateSceneNode(this.editingElement.ViewModel.DefaultView.ConvertFromWpfValue((object)geometry2)); sceneNode.SetLocalValueAsWpf(DesignTimeProperties.IsAnimatedProperty, (object)true); this.editingElement.SetValueAsSceneNode(Base2DElement.ClipProperty, sceneNode); this.editingElement.ViewModel.Document.OnUpdatedEditTransaction(); } if (this.EditingElement.IsAttached && (this.ViewModel.AnimationEditor.IsKeyFraming || isAnimated)) { new PathDiff(this.EditingElement, Base2DElement.ClipProperty, this.PathDiffChangeList).SetPathUsingMinimalDiff(pathGeometry1); } else { PathGeometry pathGeometry2 = PathGeometryUtilities.RemoveMapping(pathGeometry1, true); this.EditingElement.SetValueAsWpf(Base2DElement.ClipProperty, (object)pathGeometry2); } }
public override void UpdateCachedPath() { PathGeometry original = (PathGeometry)null; if (this.pathElement.IsAttached) { original = this.ViewModel.AnimationEditor.ActiveStoryboardTimeline == null ? this.pathElement.PathGeometry : PathGeometryUtilities.GetPathGeometryFromGeometry(this.pathElement.GetComputedValueAsWpf(PathElement.DataProperty) as System.Windows.Media.Geometry); } if (original != null) { this.PathGeometry = PathGeometryUtilities.Copy(original, false); if (!this.IsCurrentlyEditing) { return; } this.EnsureOnlySingleSegments(); } else { this.PathGeometry = new PathGeometry(); } }
public static void CleanUpPathGeometry(ref PathGeometry geometry) { if (geometry == null) { return; } if (geometry.Figures.Count == 0) { geometry = (PathGeometry)null; } else { geometry = PathGeometryUtilities.Copy(geometry, false); foreach (PathFigure pathFigure in geometry.Figures) { foreach (PathSegment pathSegment in pathFigure.Segments) { pathSegment.ClearValue(PathSegment.IsStrokedProperty); pathSegment.ClearValue(PathSegment.IsSmoothJoinProperty); } } } }
protected override void EndEditingInternal(bool pathJustCreated) { this.ViewModel.AnimationEditor.SetMotionPath((SceneElement)this.editingElement, PathGeometryUtilities.Copy(this.PathGeometry, true), new double?(), new double?()); }
public override void UpdateCachedPath() { PathAnimationSceneNode pathAnimation = this.GetPathAnimation(); this.PathGeometry = pathAnimation == null || pathAnimation.Path == null ? new PathGeometry() : PathGeometryUtilities.Copy(pathAnimation.Path, true); }