public override void Update(VAEntitySnapshot snapshot1, Func<double, double> scaleX, Func<double, double> scaleY) { if(!Fit(snapshot1)) throw new InvalidOperationException(); var snapshot = (VAObjectSnapshot)snapshot1; this.BoundingBox = Scale(snapshot.BoundingBox, scaleX, scaleY); if (this.Trajectory.Count == 0) { var sp = snapshot.StartPosition != default(Point) ? snapshot.StartPosition : snapshot.CurrentPosition; this.StartPosition = Scale(sp, scaleX, scaleY); this.Trajectory.Add(this.StartPosition); } else { const int sizeMax = 10000; this.Trajectory.ShiftPush(Scale(snapshot.CurrentPosition, scaleX, scaleY), sizeMax); } FireUpdated(); }
public override bool Fit(VAEntitySnapshot snapshot) { return snapshot is VAObjectSnapshot && ((VAObjectSnapshot)snapshot).Id == this.Id; }