diff options
author | joye <joye> | 2014-03-20 18:57:27 (GMT) |
---|---|---|
committer | joye <joye> | 2014-03-20 18:57:27 (GMT) |
commit | 246b47f0b90e9db7160cc7a266cdd81697bab949 (patch) | |
tree | 46905a58793fa1f90b428bbfd5ecf7005450cc00 /src/bltGrElemLine.C | |
parent | 728d5bf2094ca2919b3ee586912558cd78267298 (diff) | |
download | blt-246b47f0b90e9db7160cc7a266cdd81697bab949.zip blt-246b47f0b90e9db7160cc7a266cdd81697bab949.tar.gz blt-246b47f0b90e9db7160cc7a266cdd81697bab949.tar.bz2 |
*** empty log message ***
Diffstat (limited to 'src/bltGrElemLine.C')
-rw-r--r-- | src/bltGrElemLine.C | 59 |
1 files changed, 22 insertions, 37 deletions
diff --git a/src/bltGrElemLine.C b/src/bltGrElemLine.C index dbb0d99..907ef82 100644 --- a/src/bltGrElemLine.C +++ b/src/bltGrElemLine.C @@ -2887,18 +2887,14 @@ static void DrawSymbols(Graph* graphPtr, Drawable drawable, case SYMBOL_BITMAP: { - Pixmap bitmap, mask; int w, h, bw, bh; double scale, sx, sy; int dx, dy; Tk_SizeOfBitmap(graphPtr->display, penPtr->symbol.bitmap, &w, &h); - mask = None; - /* - * Compute the size of the scaled bitmap. Stretch the bitmap to fit - * a nxn bounding box. - */ + // Compute the size of the scaled bitmap. Stretch the bitmap to fit + // a nxn bounding box. sx = (double)size / (double)w; sy = (double)size / (double)h; scale = MIN(sx, sy); @@ -2906,57 +2902,46 @@ static void DrawSymbols(Graph* graphPtr, Drawable drawable, bh = (int)(h * scale); XSetClipMask(graphPtr->display, penPtr->symbol.outlineGC, None); - if (penPtr->symbol.mask != None) { - mask = Blt_ScaleBitmap(graphPtr->tkwin, penPtr->symbol.mask, - w, h, bw, bh); - XSetClipMask(graphPtr->display, penPtr->symbol.outlineGC, mask); - } - bitmap = Blt_ScaleBitmap(graphPtr->tkwin, penPtr->symbol.bitmap, - w, h, bw, bh); - if (penPtr->symbol.fillGC == NULL) { + if (penPtr->symbol.mask != None) + XSetClipMask(graphPtr->display, penPtr->symbol.outlineGC, + penPtr->symbol.mask); + + if (penPtr->symbol.fillGC == NULL) XSetClipMask(graphPtr->display, penPtr->symbol.outlineGC, - bitmap); - } + penPtr->symbol.bitmap); + dx = bw / 2; dy = bh / 2; + if (elemPtr->symbolInterval > 0) { Point2d *pp, *endp; - for (pp = symbolPts, endp = pp + nSymbolPts; pp < endp; pp++) { if (DRAW_SYMBOL(elemPtr)) { - int x, y; - - x = Round(pp->x) - dx; - y = Round(pp->y) - dy; - if ((penPtr->symbol.fillGC == NULL) || (mask != None)) { + int x = Round(pp->x) - dx; + int y = Round(pp->y) - dy; + if ((penPtr->symbol.fillGC == NULL) || + (penPtr->symbol.mask != None)) XSetClipOrigin(graphPtr->display, penPtr->symbol.outlineGC, x, y); - } - XCopyPlane(graphPtr->display, bitmap, drawable, + XCopyPlane(graphPtr->display, penPtr->symbol.bitmap, drawable, penPtr->symbol.outlineGC, 0, 0, bw, bh, x, y, 1); } elemPtr->symbolCounter++; } - } else { + } + else { Point2d *pp, *endp; - for (pp = symbolPts, endp = pp + nSymbolPts; pp < endp; pp++) { - int x, y; - - x = Round(pp->x) - dx; - y = Round(pp->y) - dy; - if ((penPtr->symbol.fillGC == NULL) || (mask != None)) { + int x = Round(pp->x) - dx; + int y = Round(pp->y) - dy; + if ((penPtr->symbol.fillGC == NULL) || + (penPtr->symbol.mask != None)) XSetClipOrigin(graphPtr->display, penPtr->symbol.outlineGC, x, y); - } - XCopyPlane(graphPtr->display, bitmap, drawable, + XCopyPlane(graphPtr->display, penPtr->symbol.bitmap, drawable, penPtr->symbol.outlineGC, 0, 0, bw, bh, x, y, 1); } } - Tk_FreePixmap(graphPtr->display, bitmap); - if (mask != None) { - Tk_FreePixmap(graphPtr->display, mask); - } } break; } |