summaryrefslogtreecommitdiffstats
path: root/tksao/frame
diff options
context:
space:
mode:
authorWilliam Joye <wjoye@cfa.harvard.edu>2017-03-27 18:31:13 (GMT)
committerWilliam Joye <wjoye@cfa.harvard.edu>2017-03-27 18:31:13 (GMT)
commitea0a457905c24f7e8de422ed469c5d4370cd735c (patch)
tree3ccd6868bd2bb86e80a7809bacf364a29bc67fd0 /tksao/frame
parent87c5f264f9f8811e7ae90d72c5bb3455a9b4180b (diff)
downloadblt-ea0a457905c24f7e8de422ed469c5d4370cd735c.zip
blt-ea0a457905c24f7e8de422ed469c5d4370cd735c.tar.gz
blt-ea0a457905c24f7e8de422ed469c5d4370cd735c.tar.bz2
contours
Diffstat (limited to 'tksao/frame')
-rw-r--r--tksao/frame/base.C46
-rw-r--r--tksao/frame/contour.C2
2 files changed, 33 insertions, 15 deletions
diff --git a/tksao/frame/base.C b/tksao/frame/base.C
index 3bf33bc..4687a0f 100644
--- a/tksao/frame/base.C
+++ b/tksao/frame/base.C
@@ -1716,7 +1716,7 @@ void Base::updateMagnifier(const Vector& vv)
// render contours
// needs to before markers if marker is filled
currentContext->contourX11(magnifierPixmap, Coord::MAGNIFIER,
- bbox(0,0,magnifierWidth,magnifierHeight));
+ BBox(0,0,magnifierWidth,magnifierHeight));
if (showMarkers) {
x11MagnifierMarkers(&userMarkers, bb);
@@ -1924,6 +1924,7 @@ int Base::updatePixmap(const BBox& bb)
void Base::updatePM(const BBox& bbox)
{
// bbox is in Canvas Coords
+ cerr << bbox << endl;
if (DebugPerf)
cerr << "Base::updatePM()...";
@@ -1939,24 +1940,25 @@ void Base::updatePM(const BBox& bbox)
}
}
- if (!bbox.isEmpty()) {
- BBox bb = bbox * canvasToWidget;
- int x0 = (int)bb.ll[0] > 0 ? (int)bb.ll[0] : 0;
- int y0 = (int)bb.ll[1] > 0 ? (int)bb.ll[1] : 0;
- int x1 = (int)bb.ur[0] < width ? (int)bb.ur[0] : width;
- int y1 = (int)bb.ur[1] < height ? (int)bb.ur[1] : height;
- int sx = x1-x0;
- int sy = y1-y0;
+ if (bbox.isEmpty())
+ return;
- if (DebugPerf)
- cerr << ' ' << x0 << ' ' << y0 << ' ' << x1 << ' ' << y1 << ' ';
+ BBox bb = bbox * canvasToWidget;
+ int x0 = (int)bb.ll[0] > 0 ? (int)bb.ll[0] : 0;
+ int y0 = (int)bb.ll[1] > 0 ? (int)bb.ll[1] : 0;
+ int x1 = (int)bb.ur[0] < width ? (int)bb.ur[0] : width;
+ int y1 = (int)bb.ur[1] < height ? (int)bb.ur[1] : height;
+ int sx = x1-x0;
+ int sy = y1-y0;
- XCopyArea(display, basePixmap, pixmap, widgetGC, x0, y0, sx, sy, x0, y0);
- }
+ if (DebugPerf)
+ cerr << ' ' << x0 << ' ' << y0 << ' ' << x1 << ' ' << y1 << ' ';
+
+ XCopyArea(display, basePixmap, pixmap, widgetGC, x0, y0, sx, sy, x0, y0);
// contours
// needs to before markers if marker is filled
- currentContext->contourX11(pixmap, Coord::WIDGET, bbox);
+ currentContext->contourX11(pixmap, Coord::WIDGET, bb);
// markers
if (showMarkers) {
@@ -1967,8 +1969,22 @@ void Base::updatePM(const BBox& bbox)
// grid
// needs to be after markers if marker is filled
- if (grid)
+ if (grid) {
+ if (0) {
+ cerr << bbox << endl;
+ BBox bb = bbox;
+ XRectangle rr[1];
+ Vector ss = bb.size();
+
+ rr[0].x = (int)bb.ll[0];
+ rr[0].y = (int)bb.ll[1];
+ rr[0].width = (int)ss[0];
+ rr[0].height = (int)ss[1];
+
+ XSetClipRectangles(display, gridGC_, 0, 0, rr, 1, Unsorted);
+ }
grid->x11();
+ }
// crosshair
if (useCrosshair)
diff --git a/tksao/frame/contour.C b/tksao/frame/contour.C
index 5b38f9a..71f9b25 100644
--- a/tksao/frame/contour.C
+++ b/tksao/frame/contour.C
@@ -148,6 +148,8 @@ void Contour::list(ostream& str, FitsImage* fits,
void Contour::render(Pixmap pmap, Coord::InternalSystem sys, const BBox& bbox)
{
+ // bbox is in sys coords
+
if (lvertex_.head()) {
XSetForeground(base_->display, parent_->gc_, parent_->color_);
int ww = parent_->lineWidth_>=1 ? parent_->lineWidth_ : 1;