public void ApplyScale(Vector scale, Point origin, Point fixedPoint) { this.Translation += new Vector((1.0 - scale.X) * (fixedPoint.X - origin.X), (1.0 - scale.Y) * (fixedPoint.Y - origin.Y)) * this.Value; double num1 = Tolerances.NearZero(this.ScaleX) ? 0.001 : this.ScaleX; double num2 = Tolerances.NearZero(this.ScaleY) ? 0.001 : this.ScaleY; this.Scale = new Vector(num1 * scale.X, num2 * scale.Y); }
public static bool NearZero(Vector vector) { if (Tolerances.NearZero(vector.X)) { return(Tolerances.NearZero(vector.Y)); } return(false); }