Example #1
0
        void renderBox(iDrawContext context, iGeometry geometry, int id, float boundingBoxesOpacity, ref Matrix3x2 tform)
        {
            // if( id != 0 ) return;

            Rect box;

            if (geometry is iPathGeometry pathGeometry)
            {
                box = pathGeometry.getApproximateBounds(ref tform);
            }
            else
            {
                box = geometry.getBounds(ref tform);
            }

            Vector4 color = Color.moreRandomColor(id);

            if (context.device.premultipliedAlphaBrushes)
            {
                color *= boundingBoxesOpacity;
            }
            else
            {
                color.W = boundingBoxesOpacity;
            }
            context.transform.pushIdentity();
            context.drawRectangle(box, context.device.createSolidColorBrush(color), 1);
            context.transform.pop();
        }
Example #2
0
        void iDrawContext.fillAndStroke(iGeometry geometry, iBrush fill, iBrush stroke, float strokeWidth, iStrokeStyle strokeStyle)
        {
            sStrokeStyle  ss   = strokeStyle?.strokeStyle ?? defaultStrokeStyle();
            iPathGeometry path = (iPathGeometry)geometry;

            fillAndStrokeGeometry(path, fill.data(), stroke.data(), strokeWidth, ref ss);
        }
Example #3
0
 void iDrawContext.fillGeometry(iGeometry geometry, iBrush brush)
 {
     switch (brush)
     {
     case SolidColorBrush solidColor:
         var cd = solidColor.data;
         fillGeometry((iPathGeometry)geometry, cd, true);
         return;
     }
     throw new NotImplementedException();
 }
Example #4
0
 void iDrawContext.drawGeometry(iGeometry geometry, iBrush brush, float width, iStrokeStyle strokeStyle)
 {
     switch (brush)
     {
     case SolidColorBrush solidColor:
         var          cd = solidColor.data;
         sStrokeStyle ss = strokeStyle?.strokeStyle ?? defaultStrokeStyle();
         strokeGeometry((iPathGeometry)geometry, cd, null, width, ref ss);
         return;
     }
     throw new NotImplementedException();
 }
Example #5
0
 public SvgPath(iGeometry geometry, SvgPathStyle style)
 {
     this.geometry = geometry;
     this.style    = style;
 }