Ejemplo n.º 1
0
        public static RectDouble GetCanvasViewportBounds(this CanvasView canvasView)
        {
            RectDouble canvasBounds = canvasView.GetCanvasBounds();
            RectDouble extentRect   = canvasView.ConvertCanvasToExtent(canvasBounds);

            return(canvasView.ConvertExtentToViewport(extentRect));
        }
Ejemplo n.º 2
0
 private void OnCanvasViewIsHighQualityScalingEnabledChanged(object sender, ValueChangedEventArgs <bool> e)
 {
     if (!base.CheckAccess())
     {
         PaintDotNet.Canvas.Canvas owner = base.Owner;
         if ((owner != null) && (owner.Dispatcher != null))
         {
             try
             {
                 object[] args = new object[] { sender, e };
                 base.Owner.Dispatcher.BeginInvoke(new Action <object, ValueChangedEventArgs <bool> >(this.OnCanvasViewIsHighQualityScalingEnabledChanged), args);
             }
             catch (Exception)
             {
             }
         }
     }
     else if (!base.IsDisposed)
     {
         CanvasView key = (CanvasView)sender;
         if (this.documentCanvasLayerViews.ContainsKey(key))
         {
             this.RecreateDocumentCanvasLayerView(key);
             key.Invalidate(key.GetCanvasBounds());
         }
     }
 }
Ejemplo n.º 3
0
        private static void OnIsPixelGridEnabledPropertyChanged(DependencyObject target, DependencyPropertyChangedEventArgs e)
        {
            CanvasView canvasView = (CanvasView)target;

            canvasView.Invalidate(canvasView.GetCanvasBounds());
            RaiseIsPixelGridEnabledChanged(canvasView, e);
        }