public void Scale(double scaleX, double scaleY) { if (!this.IsEmpty) { this._x *= scaleX; this._y *= scaleY; this._width *= scaleX; this._height *= scaleY; if (scaleX < 0.0) { this._x += this._width; this._width *= -1.0; } if (scaleY < 0.0) { this._y += this._height; this._height *= -1.0; } } }
public static Rect OffsetRect(Rect rect, Vector offset, double scale) { Rect result = new Rect(rect.TopLeft, rect.BottomRight); result.Offset(offset); result.Scale(scale, scale); return result; }