summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorscuri <scuri>2010-04-29 16:12:58 +0000
committerscuri <scuri>2010-04-29 16:12:58 +0000
commitafaff9e085b51c822f0ce31ac91cc8196bfa5113 (patch)
treec8eb0a5437797c1efbea40d1d479f7a0035dc40b
parent960149c4fc4aee0cc886d5447670e66a07531965 (diff)
Changed: CD_DXF now supports solid filled primitives for polygons and rectangles.
-rw-r--r--html/en/drv/dxf.html10
-rw-r--r--html/en/history.html2
-rw-r--r--src/drv/cddxf.c46
3 files changed, 44 insertions, 14 deletions
diff --git a/html/en/drv/dxf.html b/html/en/drv/dxf.html
index 0637e92..31cf2e6 100644
--- a/html/en/drv/dxf.html
+++ b/html/en/drv/dxf.html
@@ -65,18 +65,15 @@
</ul>
<h4>Primitives</h4>
<ul>
- <li><a href="../func/filled.html#cdBox"><font face="Courier"><strong>Box</strong></font></a>:
- draws only the box's borders (no filling function is supported). Behaves like
- <strong><font face="Courier">Rect</font></strong>.</li>
<li><a href="../func/filled.html#cdSector"><font face="Courier"><strong>Sector</strong></font></a>:
draws a &quot;hollow&quot; sector, that is, only its borders.</li>
<li><a href="../func/lines.html#cdBegin"><font face="Courier"><strong>Begin</strong></font></a>:
- <font face="Courier"><strong><tt>CD_FILL</tt></strong></font> is mapped to <font face="Courier"><strong><tt>
- CD_CLOSED_LINES</tt></strong></font>. if parameter <strong><tt>CD_CLIP</tt></strong> or <strong><tt>CD_BEZIER</tt></strong>
+ if parameter <strong><tt>CD_CLIP</tt></strong> or <strong><tt>CD_BEZIER</tt></strong>
are specified, does nothing.</li>
<li><strong><font face="Courier"><a href="../func/filled.html#cdChord">Chord</a></font></strong>:
does nothing.</li>
<li>Floating point primitives are supported.</li>
+ <li>Solid filled primitives are supported only for polygons and rectangles.</li>
</ul>
<h4>Attributes</h4>
<ul>
@@ -85,9 +82,6 @@
<li><a href="../func/attributes.html#cdWriteMode"><font face="Courier">
<strong>
WriteMode</strong></font></a>: does nothing, returns <font face="Courier">CD_REPLACE</font>.</li>
- <li><a href="../func/filled.html#cdInteriorStyle"><font face="Courier">
- <strong>
- InteriorStyle</strong></font></a>: does nothing (filling is not supported), returns 0.</li>
<li><a href="../func/filled.html#cdHatch"><font face="Courier"><strong>Hatch</strong></font></a>:
does nothing. </li>
<li><a href="../func/filled.html#cdFillMode"><font face="Courier"><strong>
diff --git a/html/en/history.html b/html/en/history.html
index 6aac73c..27000a0 100644
--- a/html/en/history.html
+++ b/html/en/history.html
@@ -23,6 +23,8 @@
<ul>
<li><span style="color: #0000FF">New:</span> &quot;CMD&quot;, &quot;OPACITY&quot; and &quot;HATCHBOXSIZE&quot;
attributes in the SVG driver.</li>
+ <li><span class="style1">Changed</span><span class="hist_changed">:</span>
+ CD_DXF now supports solid filled primitives for polygons and rectangles.</li>
<li><span style="color: #FF0000">Fixed:</span> PDF driver documentation,
<strong>CanvasBackOpacity</strong> and <strong>CanvasBackground</strong> are
supported.</li>
diff --git a/src/drv/cddxf.c b/src/drv/cddxf.c
index 1c961fa..9f67ef4 100644
--- a/src/drv/cddxf.c
+++ b/src/drv/cddxf.c
@@ -465,7 +465,7 @@ static void cdline (cdCtxCanvas *ctxcanvas, int x1, int y1, int x2, int y2)
writepoly (ctxcanvas, line, 2); /* draw line as a polygon */
}
-static void cdboxrect(cdCtxCanvas *ctxcanvas, int xmin, int xmax, int ymin, int ymax)
+static void cdrect(cdCtxCanvas *ctxcanvas, int xmin, int xmax, int ymin, int ymax)
{
cdPoint rect[5]; /* uses new array of points to avoid */
@@ -482,6 +482,23 @@ static void cdboxrect(cdCtxCanvas *ctxcanvas, int xmin, int xmax, int ymin, int
writepoly (ctxcanvas, rect, 5); /* draw box as a polygon */
}
+static void cdbox(cdCtxCanvas *ctxcanvas, int xmin, int xmax, int ymin, int ymax)
+{
+ cdPoint rect[5]; /* uses new array of points to avoid */
+
+ rect[0].x = xmin;
+ rect[0].y = ymin;
+ rect[1].x = xmin;
+ rect[1].y = ymax;
+ rect[2].x = xmax; /* box edges */
+ rect[2].y = ymax;
+ rect[3].x = xmax;
+ rect[3].y = ymin;
+ rect[4].x = xmin;
+ rect[4].y = ymin;
+ writehatch (ctxcanvas, rect, 5); /* write fill area */
+}
+
static void cdfpoly(cdCtxCanvas *ctxcanvas, int mode, cdfPoint* poly, int n)
{
if (mode == CD_CLOSED_LINES || mode == CD_FILL)
@@ -508,7 +525,7 @@ static void cdfline (cdCtxCanvas *ctxcanvas, double x1, double y1, double x2, do
writepolyf (ctxcanvas, line, 2); /* draw line as a polygon */
}
-static void cdfboxrect(cdCtxCanvas *ctxcanvas, double xmin, double xmax, double ymin, double ymax)
+static void cdfrect(cdCtxCanvas *ctxcanvas, double xmin, double xmax, double ymin, double ymax)
{
cdfPoint rect[5]; /* uses new array of points to avoid */
@@ -525,6 +542,23 @@ static void cdfboxrect(cdCtxCanvas *ctxcanvas, double xmin, double xmax, double
writepolyf (ctxcanvas, rect, 5); /* draw box as a polygon */
}
+static void cdfbox(cdCtxCanvas *ctxcanvas, double xmin, double xmax, double ymin, double ymax)
+{
+ cdfPoint rect[5]; /* uses new array of points to avoid */
+
+ rect[0].x = xmin;
+ rect[0].y = ymin;
+ rect[1].x = xmin;
+ rect[1].y = ymax;
+ rect[2].x = xmax; /* box edges */
+ rect[2].y = ymax;
+ rect[3].x = xmax;
+ rect[3].y = ymin;
+ rect[4].x = xmin;
+ rect[4].y = ymin;
+ writehatchf (ctxcanvas, rect, 5); /* write fill area */
+}
+
/*--------------------------------------------------------------------------*/
/* gives radius of the circle most resembling elliptic arc at angle t */
/*--------------------------------------------------------------------------*/
@@ -1270,12 +1304,12 @@ static void cdinittable(cdCanvas* canvas)
canvas->cxPixel = cdpixel;
canvas->cxLine = cdline;
canvas->cxPoly = cdpoly;
- canvas->cxRect = cdboxrect;
- canvas->cxBox = cdboxrect;
+ canvas->cxRect = cdrect;
+ canvas->cxBox = cdbox;
canvas->cxFLine = cdfline;
canvas->cxFPoly = cdfpoly;
- canvas->cxFRect = cdfboxrect;
- canvas->cxFBox = cdfboxrect;
+ canvas->cxFRect = cdfrect;
+ canvas->cxFBox = cdfbox;
canvas->cxArc = cdarc;
canvas->cxSector = cdsector;
canvas->cxText = cdtext;