diff options
author | William Joye <wjoye@cfa.harvard.edu> | 2019-01-23 19:14:26 (GMT) |
---|---|---|
committer | William Joye <wjoye@cfa.harvard.edu> | 2019-01-23 19:14:26 (GMT) |
commit | f10065035d4c80a05f646b1eb0299fc56e8afa19 (patch) | |
tree | 4301fd2b9c1f40e56491f24edf0a9fbc5ef6a866 /tksao/frame | |
parent | 3f07ef324bff63299229e50d5793fc04e01015a5 (diff) | |
download | blt-f10065035d4c80a05f646b1eb0299fc56e8afa19.zip blt-f10065035d4c80a05f646b1eb0299fc56e8afa19.tar.gz blt-f10065035d4c80a05f646b1eb0299fc56e8afa19.tar.bz2 |
fix aqua rotation and colormap
Diffstat (limited to 'tksao/frame')
-rw-r--r-- | tksao/frame/frame.C | 30 | ||||
-rw-r--r-- | tksao/frame/framebase.C | 12 | ||||
-rw-r--r-- | tksao/frame/frcommand.C | 16 |
3 files changed, 47 insertions, 11 deletions
diff --git a/tksao/frame/frame.C b/tksao/frame/frame.C index 2e69841..692a0ae 100644 --- a/tksao/frame/frame.C +++ b/tksao/frame/frame.C @@ -548,6 +548,7 @@ void Frame::colormapCmd(int id, float b, float c, int i, update(BASE); } +#ifndef MAC_OSX_TK void Frame::colormapBeginCmd() { // we need a colorScale before we can render @@ -762,6 +763,35 @@ void Frame::colormapEndCmd() update(BASE); // always update } +#else +void Frame::colormapBeginCmd() {} + +void Frame::colormapMotionCmd(int id, float b, float c, int i, + unsigned char* cells, int cnt) +{ + // we need a colorScale before we can render + if (!validColorScale()) + return; + + // first check for change + if (cmapID == id && bias == b && contrast == c && invert == i && colorCells) + return; + + // we got a change + cmapID = id; + bias = b; + contrast = c; + invert = i; + + updateColorCells(cells, cnt); + updateColorScale(); + + update(BASE); + updatePanner(); +} + +void Frame::colormapEndCmd() {} +#endif void Frame::getColorbarCmd() { diff --git a/tksao/frame/framebase.C b/tksao/frame/framebase.C index 3ee699a..ec8a06c 100644 --- a/tksao/frame/framebase.C +++ b/tksao/frame/framebase.C @@ -227,19 +227,8 @@ void FrameBase::rotateMotion() double y = i*mm[1] + j*mm[4] + mm[7]; if (x >= 0 && x < width && y >= 0 && y < height) { -#if MAC_OSX_TK - // I really don't understand this - char* sptr = src + ((int)y)*rotateDestXM->bytes_per_line+ - ((int)x)*bytesPerPixel; - - *(dest+0) = *(sptr+3); - *(dest+1) = *(sptr+0); - *(dest+2) = *(sptr+1); - *(dest+3) = *(sptr+2); -#else memcpy(dest, src + ((int)y)*rotateDestXM->bytes_per_line + ((int)x)*bytesPerPixel, bytesPerPixel); -#endif } else memcpy(dest, bgTrueColor_, bytesPerPixel); @@ -255,6 +244,7 @@ void FrameBase::rotateMotion() XCopyArea(display, rotatePM, Tk_WindowId(tkwin), rotateGCXOR, 0, 0, options->width, options->height, dd[0], dd[1]); } + void FrameBase::setBinCursor() { if (context->cfits) diff --git a/tksao/frame/frcommand.C b/tksao/frame/frcommand.C index 2f2c306..949dfca 100644 --- a/tksao/frame/frcommand.C +++ b/tksao/frame/frcommand.C @@ -354,6 +354,7 @@ void FrameBase::panEndCmd(const Vector& vv) update(MATRIX); } +#ifndef MAC_OSX_TK void FrameBase::rotateBeginCmd() { // save the current rotation @@ -404,6 +405,21 @@ void FrameBase::rotateEndCmd() update(MATRIX); } +#else +void FrameBase::rotateBeginCmd() +{ + // save the current rotation + rotateRotation = rotation; +} + +void FrameBase::rotateMotionCmd(double angle) +{ + rotation = rotateRotation + angle; + update(MATRIX); +} + +void FrameBase::rotateEndCmd() {} +#endif void FrameBase::saveFitsResampleFileCmd(const char* fn) { |