Commits

Ville Suoranta authored 0c122cab70f Merge
Merge pull request #430 in CASA/casa6 from CAS-12741 to master

* commit '096c04ea4cfdaaff0e7aefe50d31ed94dd646bb1': pick up viewer wheel (CAS-12741) prevent crash with 'Zoom out to Entire Image' with unzooomed image (CAS-12741) prevent crash with 'Zoom out to Entire Image' with unzooomed image (CAS-12741)

casa5/code/display/DisplayEvents/MWCRTZoomer.cc

Modified
60 60
61 61 void MWCRTZoomer::unzoom() {
62 62 reset();
63 63 Attribute resetAtt("resetCoordinates", true);
64 64 for ( auto wc : itsWCList ) {
65 65 wc->setAttribute(resetAtt);
66 66 wc->refresh(Display::LinearCoordinateChange);
67 67 }
68 68 Vector<Double> blc(2), trc(2);
69 69 WorldCanvas *cwc = itsCurrentWC;
70 - blc(0) = cwc->linXMin();
71 - blc(1) = cwc->linYMin();
72 - trc(0) = cwc->linXMax();
73 - trc(1) = cwc->linYMax();
74 - zoomed(blc, trc);
70 + if ( cwc ) {
71 + blc(0) = cwc->linXMin();
72 + blc(1) = cwc->linYMin();
73 + trc(0) = cwc->linXMax();
74 + trc(1) = cwc->linYMax();
75 + zoomed(blc, trc);
76 + }
75 77 }
76 78
77 79 void MWCRTZoomer::zoomIn(Double factor) {
78 80 if(factor>0.) zoomOut(1./factor);
79 81 }
80 82
81 83
82 84 void MWCRTZoomer::zoomOut(Double factor) {
83 85 // Zoom out by given factor.
84 86

Everything looks good. We'll let you know here if there's anything you should know about.

Add shortcut