aboutsummaryrefslogtreecommitdiff
path: root/generic
diff options
context:
space:
mode:
authorlecoanet2000-05-26 08:38:23 +0000
committerlecoanet2000-05-26 08:38:23 +0000
commita695a1c7515502563c08dfb47dec9c0756b8c031 (patch)
treeaf0ad1a17fba254ff410b9e6e6a4f83fcffe814a /generic
parent37a4efb9f4d519cae159343e6de42ac7ceaccaee (diff)
downloadtkzinc-a695a1c7515502563c08dfb47dec9c0756b8c031.zip
tkzinc-a695a1c7515502563c08dfb47dec9c0756b8c031.tar.gz
tkzinc-a695a1c7515502563c08dfb47dec9c0756b8c031.tar.bz2
tkzinc-a695a1c7515502563c08dfb47dec9c0756b8c031.tar.xz
Correction d'un bug emp�chant le fonctionnement de curves ne
comportant qu'un point. Correction de la sous commande add de coords. Le nombre de points n'�tait pas augment�. Mise � jour de la structure de classe.
Diffstat (limited to 'generic')
-rw-r--r--generic/Curve.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/generic/Curve.c b/generic/Curve.c
index 1a9be02..5ada355 100644
--- a/generic/Curve.c
+++ b/generic/Curve.c
@@ -587,7 +587,7 @@ ReduceContours(ZnPoly *poly_in,
ZnContour *c;
ZnBool *hole;
ZnPoly cpoly, rpoly;
-
+
POLY_INIT(poly_out);
for (i = 0, hole = poly_in->holes, c = poly_in->contours;
i < poly_in->num_contours; i++, c++, hole++) {
@@ -634,7 +634,6 @@ ComputeCoordinates(Item item,
}
else if (ISCLEAR(cv->flags, REDUCED_BIT)) {
ZnPoly poly;
- printf("Contour reduction\n");
ReduceContours(&cv->shape, &poly);
POLY_SET(&cv->shape, &poly);
SET(cv->flags, REDUCED_BIT);
@@ -670,7 +669,8 @@ ComputeCoordinates(Item item,
* the first.
*/
if ((c1->points[0].x == c1->points[c1->num_points-1].x) &&
- (c1->points[0].y == c1->points[c1->num_points-1].y)) {
+ (c1->points[0].y == c1->points[c1->num_points-1].y) &&
+ (c1->num_points != 1)) {
c1->num_points--;
}
c2->num_points = c1->num_points;
@@ -840,16 +840,16 @@ ToArea(Item item,
if (!first_done) {
first_done = True;
result = PolygonInBBox(points, num_points, area, &area_enclosed);
- printf("contour %d, result %d, area_enclosed %d\n",
- i, result, area_enclosed);
+ /*printf("contour %d, result %d, area_enclosed %d\n",
+ i, result, area_enclosed);*/
if (cv->shape.holes[i] && area_enclosed) {
return -1;
}
}
else {
result2 = PolygonInBBox(points, num_points, area, &area_enclosed);
- printf("contour %d, result %d, area_enclosed %d\n",
- i, result2, area_enclosed);
+ /*printf("contour %d, result %d, area_enclosed %d\n",
+ i, result2, area_enclosed);*/
if (cv->shape.holes[i] && area_enclosed) {
return -1;
}
@@ -1495,6 +1495,7 @@ Coords(Item item,
for (i = 0; i < *num_pts; i++, index++) {
c->points[index] = (*pts)[i];
}
+ c->num_points += *num_pts;
CLEAR(cv->flags, REDUCED_BIT);
ITEM.Invalidate(item, ZN_COORDS_FLAG);
}
@@ -1573,6 +1574,11 @@ static ItemClassStruct CURVE_ITEM_CLASS = {
NULL, /* GetAnchor */
GetClipVertices,
Coords,
+ NULL, /* InsertChars */
+ NULL, /* DeleteChars */
+ NULL, /* Cursor */
+ NULL, /* Index */
+ NULL, /* Selection */
Contour,
ComputeCoordinates,
ToArea,