summaryrefslogtreecommitdiff
path: root/cd/src/x11/cdx11.c
diff options
context:
space:
mode:
authorNicolas "Pixel" Noble <pixel@nobis-crew.org>2010-09-09 01:48:52 +0200
committerNicolas "Pixel" Noble <pixel@nobis-crew.org>2010-09-09 01:50:25 +0200
commite9a184546b18cf3b796bd560561f312934004c54 (patch)
treeaa785af9a8d03f8ce276c9e9ecec78397005ec22 /cd/src/x11/cdx11.c
parent92efe73791d0998536042bfab5a1babc67d168c7 (diff)
Upgrading to CD 5.4 - and cleaning up.
Diffstat (limited to 'cd/src/x11/cdx11.c')
-rwxr-xr-xcd/src/x11/cdx11.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/cd/src/x11/cdx11.c b/cd/src/x11/cdx11.c
index 94aae39..8c59d48 100755
--- a/cd/src/x11/cdx11.c
+++ b/cd/src/x11/cdx11.c
@@ -1137,10 +1137,12 @@ static void cdarc(cdCtxCanvas *ctxcanvas, int xc, int yc, int w, int h, double a
{
if (ctxcanvas->canvas->use_matrix)
{
- cdarcSIM(ctxcanvas, xc, yc, w, h, a1, a2);
+ cdSimArc(ctxcanvas, xc, yc, w, h, a1, a2);
return;
}
+ /* angles in 1/64ths of degrees counterclockwise, similar to CD */
+
cdxCheckSolidStyle(ctxcanvas, 1);
XDrawArc(ctxcanvas->dpy, ctxcanvas->wnd, ctxcanvas->gc, xc-w/2, yc-h/2, w, h, cdRound(a1*64), cdRound((a2 - a1)*64));
cdxCheckSolidStyle(ctxcanvas, 0);
@@ -1150,7 +1152,7 @@ static void cdsector(cdCtxCanvas *ctxcanvas, int xc, int yc, int w, int h, doubl
{
if (ctxcanvas->canvas->use_matrix)
{
- cdsectorSIM(ctxcanvas, xc, yc, w, h, a1, a2);
+ cdSimSector(ctxcanvas, xc, yc, w, h, a1, a2);
return;
}
@@ -1172,7 +1174,7 @@ static void cdchord(cdCtxCanvas *ctxcanvas, int xc, int yc, int w, int h, double
{
if (ctxcanvas->canvas->use_matrix)
{
- cdchordSIM(ctxcanvas, xc, yc, w, h, a1, a2);
+ cdSimChord(ctxcanvas, xc, yc, w, h, a1, a2);
return;
}
@@ -1194,7 +1196,7 @@ static void cdrect(cdCtxCanvas *ctxcanvas, int xmin, int xmax, int ymin, int yma
{
if (ctxcanvas->canvas->use_matrix)
{
- cdrectSIM(ctxcanvas, xmin, xmax, ymin, ymax);
+ cdSimRect(ctxcanvas, xmin, xmax, ymin, ymax);
return;
}
@@ -1207,7 +1209,7 @@ static void cdbox(cdCtxCanvas *ctxcanvas, int xmin, int xmax, int ymin, int ymax
{
if (ctxcanvas->canvas->use_matrix)
{
- cdboxSIM(ctxcanvas, xmin, xmax, ymin, ymax);
+ cdSimBox(ctxcanvas, xmin, xmax, ymin, ymax);
return;
}
@@ -1394,6 +1396,9 @@ void cdxPoly(cdCtxCanvas *ctxcanvas, int mode, cdPoint* poly, int n)
case CD_BEZIER:
cdSimPolyBezier(ctxcanvas->canvas, poly, n);
break;
+ case CD_PATH:
+ cdSimPolyPath(ctxcanvas->canvas, poly, n);
+ break;
}
if (pnt) free(pnt);
@@ -2192,8 +2197,11 @@ static cdCtxImage *cdcreateimage (cdCtxCanvas *ctxcanvas, int w, int h)
static void cdgetimage (cdCtxCanvas *ctxcanvas, cdCtxImage *ctximage, int x, int y)
{
+ /* y is the bottom-left of the image in CD, must be at upper-left */
+ y -= ctximage->h-1;
+
XCopyArea(ctxcanvas->dpy, ctxcanvas->wnd, ctximage->img, ctxcanvas->gc,
- x, y - ctximage->h+1, ctximage->w, ctximage->h, 0, 0);
+ x, y, ctximage->w, ctximage->h, 0, 0);
}
static void cdputimagerect (cdCtxCanvas *ctxcanvas, cdCtxImage *ctximage, int x, int y, int xmin, int xmax, int ymin, int ymax)
@@ -2243,6 +2251,7 @@ static void set_rotate_attrib(cdCtxCanvas* ctxcanvas, char* data)
{
if (data)
{
+ /* use this configuration when there is NO native tranformation support */
sscanf(data, "%g %d %d", &ctxcanvas->rotate_angle,
&ctxcanvas->rotate_center_x,
&ctxcanvas->rotate_center_y);