summaryrefslogtreecommitdiffstats
path: root/tksao
diff options
context:
space:
mode:
authorWilliam Joye <wjoye@cfa.harvard.edu>2017-03-28 15:24:09 (GMT)
committerWilliam Joye <wjoye@cfa.harvard.edu>2017-03-28 15:24:09 (GMT)
commitf3354d608a38ceee396fc4d2f28c069a83346145 (patch)
tree169d8942f496f46d08869121587fd0b7aca5e727 /tksao
parent89ffa4a4bf0b10854c25503493fdeeb5235d128e (diff)
downloadblt-f3354d608a38ceee396fc4d2f28c069a83346145.zip
blt-f3354d608a38ceee396fc4d2f28c069a83346145.tar.gz
blt-f3354d608a38ceee396fc4d2f28c069a83346145.tar.bz2
filled regions rendered XOR as non-filled
Diffstat (limited to 'tksao')
-rw-r--r--tksao/frame/basebox.C5
-rw-r--r--tksao/frame/basebox.h2
-rw-r--r--tksao/frame/baseellipse.C9
-rw-r--r--tksao/frame/baseellipse.h5
-rw-r--r--tksao/frame/box.C7
-rw-r--r--tksao/frame/box.h2
-rw-r--r--tksao/frame/circle.C8
-rw-r--r--tksao/frame/circle.h4
-rw-r--r--tksao/frame/ellipse.C8
-rw-r--r--tksao/frame/ellipse.h4
-rw-r--r--tksao/frame/polygon.C2
11 files changed, 30 insertions, 26 deletions
diff --git a/tksao/frame/basebox.C b/tksao/frame/basebox.C
index 7d55dc8..f9d5a3e 100644
--- a/tksao/frame/basebox.C
+++ b/tksao/frame/basebox.C
@@ -50,13 +50,14 @@ void BaseBox::renderX(Drawable drawable, Coord::InternalSystem sys,
pp[jj].x = (short)v[0];
pp[jj].y = (short)v[1];
}
- renderXDraw(drawable, lgc, pp);
+ renderXDraw(drawable, lgc, pp, mode);
delete [] pp;
}
deleteVertices();
}
-void BaseBox::renderXDraw(Drawable drawable, GC lgc, XPoint* pp)
+void BaseBox::renderXDraw(Drawable drawable, GC lgc, XPoint* pp,
+ RenderMode mode)
{
XDrawLines(display, drawable, lgc, pp, numPoints_, CoordModeOrigin);
}
diff --git a/tksao/frame/basebox.h b/tksao/frame/basebox.h
index 37f9ae2..b1e0602 100644
--- a/tksao/frame/basebox.h
+++ b/tksao/frame/basebox.h
@@ -27,7 +27,7 @@ class BaseBox : public BaseMarker {
protected:
void renderX(Drawable, Coord::InternalSystem, RenderMode);
- virtual void renderXDraw(Drawable drawable, GC lgc, XPoint* pp);
+ virtual void renderXDraw(Drawable, GC, XPoint*, RenderMode);
void renderPS(int);
virtual void renderPSDraw(int);
diff --git a/tksao/frame/baseellipse.C b/tksao/frame/baseellipse.C
index f80c5b0..842707a 100644
--- a/tksao/frame/baseellipse.C
+++ b/tksao/frame/baseellipse.C
@@ -93,12 +93,13 @@ void BaseEllipse::renderXCircle(Drawable drawable, Coord::InternalSystem sys,
if (a2<=a1)
a2 += 360*64;
- renderXCircleDraw(drawable, lgc, st, size, a1, (a2-a1));
+ renderXCircleDraw(drawable, lgc, st, size, a1, (a2-a1), mode);
}
}
void BaseEllipse::renderXCircleDraw(Drawable drawable, GC lgc, Vector& st,
- Vector& size, int a1, int aa)
+ Vector& size, int a1, int aa,
+ RenderMode mode)
{
XDrawArc(display, drawable, lgc, st[0], st[1], size[0], size[1], a1, aa);
}
@@ -164,7 +165,7 @@ void BaseEllipse::renderXEllipse(Drawable drawable, Coord::InternalSystem sys,
}
}
- renderXEllipseDraw(drawable, lgc);
+ renderXEllipseDraw(drawable, lgc, mode);
if (xpoint_)
free(xpoint_);
@@ -174,7 +175,7 @@ void BaseEllipse::renderXEllipse(Drawable drawable, Coord::InternalSystem sys,
}
}
-void BaseEllipse::renderXEllipseDraw(Drawable drawable, GC lgc)
+void BaseEllipse::renderXEllipseDraw(Drawable drawable, GC lgc, RenderMode mode)
{
if ((properties & SOURCE) && !(properties & DASH))
XDrawLines(display, drawable, lgc, xpoint_, xpointNum_, CoordModeOrigin);
diff --git a/tksao/frame/baseellipse.h b/tksao/frame/baseellipse.h
index 2789d81..cdeb12c 100644
--- a/tksao/frame/baseellipse.h
+++ b/tksao/frame/baseellipse.h
@@ -51,8 +51,9 @@ class BaseEllipse : public BaseMarker {
protected:
void renderX(Drawable, Coord::InternalSystem, RenderMode);
- virtual void renderXCircleDraw(Drawable, GC, Vector&, Vector&, int, int);
- virtual void renderXEllipseDraw(Drawable, GC);
+ virtual void renderXCircleDraw(Drawable, GC, Vector&, Vector&,
+ int, int, RenderMode);
+ virtual void renderXEllipseDraw(Drawable, GC, RenderMode);
void renderXEllipseDashDraw(Drawable, GC);
void renderPS(int);
diff --git a/tksao/frame/box.C b/tksao/frame/box.C
index 0bdb01c..43e1898 100644
--- a/tksao/frame/box.C
+++ b/tksao/frame/box.C
@@ -46,10 +46,11 @@ Box::Box(Base* p, const Vector& ctr,
updateBBox();
}
-void Box::renderXDraw(Drawable drawable, GC lgc, XPoint* pp)
+void Box::renderXDraw(Drawable drawable, GC lgc, XPoint* pp, RenderMode mode)
{
- if (fill_)
- XFillPolygon(display, drawable, lgc, pp, numPoints_, Convex, CoordModeOrigin);
+ if (fill_ && mode == SRC)
+ XFillPolygon(display, drawable, lgc, pp, numPoints_, Convex,
+ CoordModeOrigin);
else
XDrawLines(display, drawable, lgc, pp, numPoints_, CoordModeOrigin);
}
diff --git a/tksao/frame/box.h b/tksao/frame/box.h
index e558688..9852657 100644
--- a/tksao/frame/box.h
+++ b/tksao/frame/box.h
@@ -12,7 +12,7 @@ class Box : public BaseBox {
int fill_;
protected:
- void renderXDraw(Drawable drawable, GC lgc, XPoint* pp);
+ void renderXDraw(Drawable, GC, XPoint*, RenderMode);
void renderPSDraw(int);
#ifdef MAC_OSX_TK
diff --git a/tksao/frame/circle.C b/tksao/frame/circle.C
index 6d4971d..e643e47 100644
--- a/tksao/frame/circle.C
+++ b/tksao/frame/circle.C
@@ -60,17 +60,17 @@ void Circle::edit(const Vector& v, int h)
void Circle::renderXCircleDraw(Drawable drawable, GC lgc,
Vector& st, Vector& size,
- int a1, int aa)
+ int a1, int aa, RenderMode mode)
{
- if (fill_)
+ if (fill_ && mode == SRC)
XFillArc(display, drawable, lgc, st[0], st[1], size[0], size[1], a1, aa);
else
XDrawArc(display, drawable, lgc, st[0], st[1], size[0], size[1], a1, aa);
}
-void Circle::renderXEllipseDraw(Drawable drawable, GC lgc)
+void Circle::renderXEllipseDraw(Drawable drawable, GC lgc, RenderMode mode)
{
- if (fill_)
+ if (fill_ && mode == SRC)
XFillPolygon(display, drawable, lgc, xpoint_, xpointNum_, Convex, CoordModeOrigin);
else if ((properties & SOURCE) && !(properties & DASH))
XDrawLines(display, drawable, lgc, xpoint_, xpointNum_, CoordModeOrigin);
diff --git a/tksao/frame/circle.h b/tksao/frame/circle.h
index eaec029..6e50a06 100644
--- a/tksao/frame/circle.h
+++ b/tksao/frame/circle.h
@@ -12,8 +12,8 @@ class Circle : public BaseEllipse {
int fill_;
protected:
- void renderXCircleDraw(Drawable, GC, Vector&, Vector&, int, int);
- void renderXEllipseDraw(Drawable, GC);
+ void renderXCircleDraw(Drawable, GC, Vector&, Vector&, int, int, RenderMode);
+ void renderXEllipseDraw(Drawable, GC, RenderMode);
void renderPSDraw();
diff --git a/tksao/frame/ellipse.C b/tksao/frame/ellipse.C
index ca712cf..c07513a 100644
--- a/tksao/frame/ellipse.C
+++ b/tksao/frame/ellipse.C
@@ -48,17 +48,17 @@ Ellipse::Ellipse(Base* p, const Vector& ctr,
void Ellipse::renderXCircleDraw(Drawable drawable, GC lgc,
Vector& st, Vector& size,
- int a1, int aa)
+ int a1, int aa, RenderMode mode)
{
- if (fill_)
+ if (fill_ && mode == SRC)
XFillArc(display, drawable, lgc, st[0], st[1], size[0], size[1], a1, aa);
else
XDrawArc(display, drawable, lgc, st[0], st[1], size[0], size[1], a1, aa);
}
-void Ellipse::renderXEllipseDraw(Drawable drawable, GC lgc)
+void Ellipse::renderXEllipseDraw(Drawable drawable, GC lgc, RenderMode mode)
{
- if (fill_)
+ if (fill_ && mode == SRC)
XFillPolygon(display, drawable, lgc, xpoint_, xpointNum_, Convex, CoordModeOrigin);
else if ((properties & SOURCE) && !(properties & DASH))
XDrawLines(display, drawable, lgc, xpoint_, xpointNum_, CoordModeOrigin);
diff --git a/tksao/frame/ellipse.h b/tksao/frame/ellipse.h
index c40a32f..43460f2 100644
--- a/tksao/frame/ellipse.h
+++ b/tksao/frame/ellipse.h
@@ -12,8 +12,8 @@ class Ellipse : public BaseEllipse {
int fill_;
protected:
- void renderXCircleDraw(Drawable, GC, Vector&, Vector&, int, int);
- void renderXEllipseDraw(Drawable, GC);
+ void renderXCircleDraw(Drawable, GC, Vector&, Vector&, int, int, RenderMode);
+ void renderXEllipseDraw(Drawable, GC, RenderMode);
void renderPSDraw();
diff --git a/tksao/frame/polygon.C b/tksao/frame/polygon.C
index 72cebcd..94d31b7 100644
--- a/tksao/frame/polygon.C
+++ b/tksao/frame/polygon.C
@@ -65,7 +65,7 @@ void Polygon::renderX(Drawable drawable, Coord::InternalSystem sys,
vertex.head();
}
- if (fill_)
+ if (fill_ && mode == SRC)
XFillPolygon(display, drawable, lgc, pp, cnt, Complex, CoordModeOrigin);
else
XDrawLines(display, drawable, lgc, pp, cnt, CoordModeOrigin);