summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjoye <joye>2014-06-16 21:54:29 (GMT)
committerjoye <joye>2014-06-16 21:54:29 (GMT)
commit26f23f0dc83d24caef81f34f817e2bfa0bb8f8a0 (patch)
tree63d0ba376975627f0dd6b35749be5c8004f2c6e5
parent693c0a4d1f527d3b5a6303edfe990001dc5e55ef (diff)
downloadblt-26f23f0dc83d24caef81f34f817e2bfa0bb8f8a0.zip
blt-26f23f0dc83d24caef81f34f817e2bfa0bb8f8a0.tar.gz
blt-26f23f0dc83d24caef81f34f817e2bfa0bb8f8a0.tar.bz2
*** empty log message ***
-rw-r--r--src/bltGrMarkerPolygon.C41
-rw-r--r--src/bltGrMarkerPolygon.h2
-rw-r--r--tests/polygonmarker.tcl4
3 files changed, 6 insertions, 41 deletions
diff --git a/src/bltGrMarkerPolygon.C b/src/bltGrMarkerPolygon.C
index af0f903..0c8e7d8 100644
--- a/src/bltGrMarkerPolygon.C
+++ b/src/bltGrMarkerPolygon.C
@@ -58,9 +58,6 @@ static Tk_OptionSpec optionSpecs[] = {
{TK_OPTION_COLOR, "-fill", "fill", "Fill",
NULL, -1, Tk_Offset(PolygonMarkerOptions, fill),
TK_OPTION_NULL_OK, NULL, 0},
- {TK_OPTION_COLOR, "-fillbg", "fillbg", "FillBg",
- NULL, -1, Tk_Offset(PolygonMarkerOptions, fillBg),
- TK_OPTION_NULL_OK, NULL, 0},
{TK_OPTION_CUSTOM, "-join", "join", "Join",
"miter", -1, Tk_Offset(PolygonMarkerOptions, joinStyle),
0, &joinStyleObjOption, 0},
@@ -75,9 +72,6 @@ static Tk_OptionSpec optionSpecs[] = {
{TK_OPTION_COLOR, "-outline", "outline", "Outline",
STD_NORMAL_FOREGROUND, -1, Tk_Offset(PolygonMarkerOptions, outline),
TK_OPTION_NULL_OK, NULL, 0},
- {TK_OPTION_COLOR, "-outlinebg", "outlinebg", "OutlineBg",
- NULL, -1, Tk_Offset(PolygonMarkerOptions, outlineBg),
- TK_OPTION_NULL_OK, NULL, 0},
{TK_OPTION_BOOLEAN, "-under", "under", "Under",
"no", -1, Tk_Offset(PolygonMarkerOptions, drawUnder), 0, NULL, CACHE},
{TK_OPTION_PIXELS, "-xoffset", "xOffset", "XOffset",
@@ -121,28 +115,22 @@ int PolygonMarker::configure()
{
PolygonMarkerOptions* ops = (PolygonMarkerOptions*)ops_;
+ // outlineGC
unsigned long gcMask = (GCLineWidth | GCLineStyle);
XGCValues gcValues;
if (ops->outline) {
gcMask |= GCForeground;
gcValues.foreground = ops->outline->pixel;
}
- if (ops->outlineBg) {
- gcMask |= GCBackground;
- gcValues.background = ops->outlineBg->pixel;
- }
gcMask |= (GCCapStyle | GCJoinStyle);
gcValues.cap_style = ops->capStyle;
gcValues.join_style = ops->joinStyle;
gcValues.line_style = LineSolid;
gcValues.dash_offset = 0;
gcValues.line_width = ops->lineWidth;
- if (LineIsDashed(ops->dashes)) {
- gcValues.line_style = (ops->outlineBg == NULL)
- ? LineOnOffDash : LineDoubleDash;
- }
+ if (LineIsDashed(ops->dashes))
+ gcValues.line_style = LineOnOffDash;
- // outlineGC
GC newGC = graphPtr_->getPrivateGC(gcMask, &gcValues);
if (LineIsDashed(ops->dashes))
graphPtr_->setDashes(newGC, &ops->dashes);
@@ -156,10 +144,6 @@ int PolygonMarker::configure()
gcMask |= GCForeground;
gcValues.foreground = ops->fill->pixel;
}
- if (ops->fillBg) {
- gcMask |= GCBackground;
- gcValues.background = ops->fillBg->pixel;
- }
newGC = Tk_GetGC(graphPtr_->tkwin_, gcMask, &gcValues);
if (fillGC_)
Tk_FreeGC(graphPtr_->display_, fillGC_);
@@ -192,10 +176,8 @@ void PolygonMarker::draw(Drawable drawable)
}
// outline
- if ((nOutlinePts_ > 0) && (ops->lineWidth > 0) &&
- (ops->outline)) {
+ if ((nOutlinePts_ > 0) && (ops->lineWidth > 0) && (ops->outline))
graphPtr_->drawSegments(drawable, outlineGC_, outlinePts_, nOutlinePts_);
- }
}
void PolygonMarker::map()
@@ -308,10 +290,6 @@ void PolygonMarker::print(PostScript* psPtr)
if (ops->fill) {
psPtr->printPolyline(fillPts_, nFillPts_);
- if (ops->fillBg) {
- psPtr->setBackground(ops->fillBg);
- psPtr->append("gsave fill grestore\n");
- }
psPtr->setForeground(ops->fill);
psPtr->append("fill\n");
}
@@ -319,16 +297,7 @@ void PolygonMarker::print(PostScript* psPtr)
if ((ops->lineWidth > 0) && (ops->outline)) {
psPtr->setLineAttributes(ops->outline, ops->lineWidth, &ops->dashes,
ops->capStyle, ops->joinStyle);
-
- if ((ops->outlineBg) && (LineIsDashed(ops->dashes))) {
- psPtr->append("/DashesProc {\ngsave\n ");
- psPtr->setBackground(ops->outlineBg);
- psPtr->append(" ");
- psPtr->setDashes((Dashes*)NULL);
- psPtr->append("stroke\n grestore\n} def\n");
- }
- else
- psPtr->append("/DashesProc {} def\n");
+ psPtr->append("/DashesProc {} def\n");
psPtr->printSegments(outlinePts_, nOutlinePts_);
}
diff --git a/src/bltGrMarkerPolygon.h b/src/bltGrMarkerPolygon.h
index 5f0f2f1..c2b90fb 100644
--- a/src/bltGrMarkerPolygon.h
+++ b/src/bltGrMarkerPolygon.h
@@ -48,11 +48,9 @@ namespace Blt {
int capStyle;
Dashes dashes;
XColor* fill;
- XColor* fillBg;
int joinStyle;
int lineWidth;
XColor* outline;
- XColor* outlineBg;
} PolygonMarkerOptions;
class PolygonMarker : public Marker {
diff --git a/tests/polygonmarker.tcl b/tests/polygonmarker.tcl
index 4917d66..e562821 100644
--- a/tests/polygonmarker.tcl
+++ b/tests/polygonmarker.tcl
@@ -15,14 +15,12 @@ bltTest3 $graph marker $mm -coords {1 50 1.5 100 2 150} $dops
bltTest3 $graph marker $mm -dashes {8 3} $dops
bltTest3 $graph marker $mm -element data1 $dops
bltTest3 $graph marker $mm -fill yellow $dops
-bltTest3 $graph marker $mm -fillbg blue $dops
bltTest3 $graph marker $mm -join round $dops
bltTest3 $graph marker $mm -linewidth 1 $dops
bltTest3 $graph marker $mm -hide yes $dops
bltTest3 $graph marker $mm -mapx x2 $dops
bltTest3 $graph marker $mm -mapy y2 $dops
-bltTest3 $graph marker $mm -outline green $dops
-bltTest3 $graph marker $mm -outlinebg cyan $dops
+bltTest3 $graph marker $mm -outline yellow $dops
bltTest3 $graph marker $mm -under yes $dops
bltTest3 $graph marker $mm -xoffset 20 $dops
bltTest3 $graph marker $mm -yoffset 20 $dops