diff options
author | William Joye <wjoye@cfa.harvard.edu> | 2020-07-22 19:26:52 (GMT) |
---|---|---|
committer | William Joye <wjoye@cfa.harvard.edu> | 2020-07-22 19:26:52 (GMT) |
commit | 7f27a43cedb771534c895921dd84eede4cd48874 (patch) | |
tree | 8b6141e38547dd5d91bf70441d6bfae852076b19 /generic | |
parent | c78ea97d07def663389d9b8a3ec24fd53029e2db (diff) | |
download | blt-7f27a43cedb771534c895921dd84eede4cd48874.zip blt-7f27a43cedb771534c895921dd84eede4cd48874.tar.gz blt-7f27a43cedb771534c895921dd84eede4cd48874.tar.bz2 |
fix bar width problem
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tkbltGrElemBar.C | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/generic/tkbltGrElemBar.C b/generic/tkbltGrElemBar.C index 6698760..c3ed9a7 100644 --- a/generic/tkbltGrElemBar.C +++ b/generic/tkbltGrElemBar.C @@ -436,8 +436,9 @@ void BarElement::map() rp->x = (int)MIN(c1.x, c2.x); - rp->width = width + 1; - rp->width |= 0x1; + rp->width = width; + if (rp->width & 0x1) + rp->width++; if (rp->width < 1) rp->width = 1; @@ -499,7 +500,8 @@ void BarElement::extents(Region2d *regPtr) int nPoints = NUMBEROFPOINTS(ops); - double middle = 0.5; + double barWidth = (ops->barWidth > 0.0) ? ops->barWidth : gops->barWidth; + double middle = barWidth/2.; regPtr->left = ops->coords.x->min() - middle; regPtr->right = ops->coords.x->max() + middle; @@ -1255,13 +1257,12 @@ void BarElement::printSegments(PSOutput* psPtr, BarPen* penPtr, continue; psPtr->fill3DRectangle(pops->fill, (double)rp->x, (double)rp->y, - (int)rp->width, (int)rp->height, + rp->width, rp->height, pops->borderWidth, pops->relief); if (pops->outlineColor) { psPtr->setForeground(pops->outlineColor); - psPtr->printRectangle((double)rp->x, (double)rp->y, - (int)rp->width, (int)rp->height); + psPtr->printRectangle((double)rp->x, (double)rp->y, rp->width, rp->height); } } } |