public ValuePoint2D GetAbsolutePoint <TPoint>(TPoint relativePoint2D, Double zoomLevel) where TPoint : IPoint2D { var CurrentLocation = CurrentElementRect.Location; if (zoomLevel.AreDifferent(1.0)) { return(new ValuePoint2D( (CurrentLocation.X + relativePoint2D.X) * zoomLevel, (CurrentLocation.Y + relativePoint2D.Y) * zoomLevel)); } return(new ValuePoint2D(CurrentLocation.X + relativePoint2D.X, CurrentLocation.Y + relativePoint2D.Y)); }
public ValueRectangle GetAbsoluteRect <TRectangle>(TRectangle relativeRect, Double zoomLevel) where TRectangle : IRectangle { var currentLocation = CurrentElementRect.Location; if (zoomLevel.AreDifferent(1.0) || !_netTransform.IsIdentity) { return(new ValueRectangle( ((relativeRect.X + currentLocation.X) * zoomLevel * _netTransform.ScaleX) + (zoomLevel * _netTransform.OffsetX), ((relativeRect.Y + currentLocation.Y) * zoomLevel * _netTransform.ScaleY) + (zoomLevel * _netTransform.OffsetY), relativeRect.Width * zoomLevel * _netTransform.ScaleX, relativeRect.Height * zoomLevel * _netTransform.ScaleY)); } return(new ValueRectangle(currentLocation.X + relativeRect.Left, currentLocation.Y + relativeRect.Top, relativeRect.Size)); }