Commits
Ville Suoranta authored 0c122cab70f Merge
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 | |