public static RectDouble GetCanvasViewportBounds(this CanvasView canvasView) { RectDouble canvasBounds = canvasView.GetCanvasBounds(); RectDouble extentRect = canvasView.ConvertCanvasToExtent(canvasBounds); return(canvasView.ConvertExtentToViewport(extentRect)); }
public static RectDouble GetVisibleCanvasViewportBounds(this CanvasView canvasView) { RectDouble viewportCanvasBounds = canvasView.ViewportCanvasBounds; RectDouble extentRect = canvasView.ConvertCanvasToExtent(viewportCanvasBounds); RectDouble a = canvasView.ConvertExtentToViewport(extentRect); RectDouble canvasViewportBounds = canvasView.GetCanvasViewportBounds(); return(RectDouble.Intersect(a, canvasViewportBounds)); }