private void DrawGridInternal(XGraphics gfx, XPen stroke, ref Spatial.Rect2 rect, double offsetX, double offsetY, double cellWidth, double cellHeight, bool isStroked) { double ox = rect.X; double oy = rect.Y; double sx = ox + offsetX; double sy = oy + offsetY; double ex = ox + rect.Width; double ey = oy + rect.Height; for (double x = sx; x < ex; x += cellWidth) { var p0 = new XPoint( _scaleToPage(x), _scaleToPage(oy)); var p1 = new XPoint( _scaleToPage(x), _scaleToPage(ey)); DrawLineInternal(gfx, stroke, isStroked, ref p0, ref p1); } for (double y = sy; y < ey; y += cellHeight) { var p0 = new XPoint( _scaleToPage(ox), _scaleToPage(y)); var p1 = new XPoint( _scaleToPage(ex), _scaleToPage(y)); DrawLineInternal(gfx, stroke, isStroked, ref p0, ref p1); } }
private void DrawGridInternal(DxfDocument dxf, Layer layer, ShapeStyle style, double offsetX, double offsetY, double cellWidth, double cellHeight, ref Spatial.Rect2 rect) { double ox = rect.X; double oy = rect.Y; double sx = ox + offsetX; double sy = oy + offsetY; double ex = ox + rect.Width; double ey = oy + rect.Height; for (double gx = sx; gx < ex; gx += cellWidth) { DrawLineInternal(dxf, layer, style, true, gx, oy, gx, ey); } for (double gy = sy; gy < ey; gy += cellHeight) { DrawLineInternal(dxf, layer, style, true, ox, gy, ex, gy); } }
private void DrawEllipseInternal(DxfDocument dxf, Layer layer, bool isFilled, bool isStroked, BaseStyle style, ref Spatial.Rect2 rect) { var dxfEllipse = CreateEllipse(rect.X, rect.Y, rect.Width, rect.Height); if (isFilled) { FillEllipse(dxf, layer, dxfEllipse, style.Fill); } if (isStroked) { StrokeEllipse(dxf, layer, dxfEllipse, style.Stroke, style.Thickness); } }
private void DrawRectangleInternal(DxfDocument dxf, Layer layer, bool isFilled, bool isStroked, BaseStyle style, ref Spatial.Rect2 rect) { if (isFilled) { FillRectangle(dxf, layer, rect.X, rect.Y, rect.Width, rect.Height, style.Fill); } if (isStroked) { StrokeRectangle(dxf, layer, style, rect.X, rect.Y, rect.Width, rect.Height); } }