diff options
author | Adrián Medraño Calvo <adrian@medranocalvo.com> | 2017-07-21 09:20:28 (GMT) |
---|---|---|
committer | Adrián Medraño Calvo <adrian@medranocalvo.com> | 2017-07-21 11:40:48 (GMT) |
commit | f14d9dc7c790f40e897bf4f3afaacdde6509adac (patch) | |
tree | 9decc8ccfb18a38a94568feea8c9dc66e4ff6fd2 /generic/tkbltGraph.C | |
parent | 095e27e5a9b983b7a20ea6bc4b9f4989ddb9a160 (diff) | |
download | blt-f14d9dc7c790f40e897bf4f3afaacdde6509adac.zip blt-f14d9dc7c790f40e897bf4f3afaacdde6509adac.tar.gz blt-f14d9dc7c790f40e897bf4f3afaacdde6509adac.tar.bz2 |
Enforce explicit downcasting of numeric values
As part of the change, upgrade tkblt internal structures from
short/float to int/double, as those are artifacts of the legacy code
relying on X. Downcast to short at the latest stage: when interfacing
with X.
Diffstat (limited to 'generic/tkbltGraph.C')
-rw-r--r-- | generic/tkbltGraph.C | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/generic/tkbltGraph.C b/generic/tkbltGraph.C index bb1707d..13e0e9a 100644 --- a/generic/tkbltGraph.C +++ b/generic/tkbltGraph.C @@ -510,13 +510,13 @@ void Graph::reconfigure() void Graph::drawMargins(Drawable drawable) { GraphOptions* ops = (GraphOptions*)ops_; - XRectangle rects[4]; + Rectangle rects[4]; // Draw the four outer rectangles which encompass the plotting // surface. This clears the surrounding area and clips the plot. rects[0].x = rects[0].y = rects[3].x = rects[1].x = 0; - rects[0].width = rects[3].width = (short int)width_; - rects[0].height = (short int)top_; + rects[0].width = rects[3].width = width_; + rects[0].height = top_; rects[3].y = bottom_; rects[3].height = height_ - bottom_; rects[2].y = rects[1].y = top_; @@ -558,7 +558,7 @@ void Graph::printMargins(PSOutput* psPtr) { GraphOptions* ops = (GraphOptions*)ops_; PostscriptOptions* pops = (PostscriptOptions*)postscript_->ops_; - XRectangle margin[4]; + Rectangle margin[4]; margin[0].x = margin[0].y = margin[3].x = margin[1].x = 0; margin[0].width = margin[3].width = width_; @@ -595,7 +595,7 @@ void Graph::printMargins(PSOutput* psPtr) if (ops->title) { psPtr->append("% Graph title\n"); TextStyle ts(this, &ops->titleTextStyle); - ts.printText(psPtr, ops->title, (double)titleX_, (double)titleY_); + ts.printText(psPtr, ops->title, titleX_, titleY_); } } @@ -1426,7 +1426,7 @@ void Graph::drawSegments(Drawable drawable, GC gc, Segment2d* segments, int nSegments) { for (Segment2d *sp = segments, *send = sp + nSegments; sp < send; sp++) - XDrawLine(display_, drawable, gc, sp->p.x, sp->p.y, sp->q.x, sp->q.y); + XDrawLine(display_, drawable, gc, (int)sp->p.x, (int)sp->p.y, (int)sp->q.x, (int)sp->q.y); } GC Graph::getPrivateGC(unsigned long gcMask, XGCValues *valuePtr) |