예제 #1
0
 internal virtual void setClip(ui.geom.Rectangle clip)
 {
     removeClip();
     if (clip == null)
     {
         return;
     }
     if (clip.getWidth() <= 0)
     {
         // System.Diagnostics.Debug.WriteLine("aaaaaaaaaaaaaaaaaaaa width");
         clip.setWidth(1);
     }
     if (clip.getHeight() <= 0)
     {
         // System.Diagnostics.Debug.WriteLine("aaaaaaaaaaaaaaaaaaaa height");
         clip.setHeight(1);
     }
     if (transform != null && !transform.isIdentity())
     {
         GeneralPath gp = new GeneralPath();
         gp.setShape(clip, transform);
         layer = graphics.CreateLayer(1f, CanvasGeometry.CreatePath(SilverlightImplementation.instance.cn1ShapeToAndroidPath(gp)));
     }
     else
     {
         layer = graphics.CreateLayer(1f, new Rect(
                                          clip.getX(),
                                          clip.getY(),
                                          clip.getWidth(),
                                          clip.getHeight()
                                          ));
     }
 }
예제 #2
0
 internal virtual void setClip(ui.geom.Rectangle clip)
 {
     if (clip == null)
     {
         return;
     }
     if (clip.getWidth() <= 0)
     {
         // System.Diagnostics.Debug.WriteLine("aaaaaaaaaaaaaaaaaaaa width");
         clip.setWidth(1);
     }
     if (clip.getHeight() <= 0)
     {
         // System.Diagnostics.Debug.WriteLine("aaaaaaaaaaaaaaaaaaaa height");
         clip.setHeight(1);
     }
     layer = graphics.CreateLayer(1, new Rect(
                                      clip.getX(),
                                      clip.getY(),
                                      clip.getWidth(),
                                      clip.getHeight()
                                      ));
 }