diff --git a/rtgui/crophandler.cc b/rtgui/crophandler.cc index 961b83c7c..c22b5b529 100644 --- a/rtgui/crophandler.cc +++ b/rtgui/crophandler.cc @@ -110,6 +110,16 @@ void CropHandler::sizeChanged (int x, int y, int ow, int oh) // the ipc notif */ } +bool CropHandler::isFullDisplay () +{ + int w, h; + getFullImageSize(w, h); + if (!w) { + return false; + } + return cropW == w && cropH == h; +} + double CropHandler::getFitCropZoom () { double z1 = (double) wh / cropParams.h; diff --git a/rtgui/crophandler.h b/rtgui/crophandler.h index 1350df27e..3bf7e58da 100644 --- a/rtgui/crophandler.h +++ b/rtgui/crophandler.h @@ -100,6 +100,7 @@ public: float getZoomFactor (); double getFitZoom (); double getFitCropZoom(); + bool isFullDisplay (); void setWSize (int w, int h); void getWSize (int& w, int &h); void getAnchorPosition (int& x, int& y); diff --git a/rtgui/cropwindow.cc b/rtgui/cropwindow.cc index 2bf446842..10b188a21 100644 --- a/rtgui/cropwindow.cc +++ b/rtgui/cropwindow.cc @@ -1728,7 +1728,7 @@ void CropWindow::expose (Cairo::RefPtr cr) if (cropHandler.cropParams.enabled) { int cropX, cropY; cropHandler.getPosition (cropX, cropY); - drawCrop (cr, x + imgAreaX + imgX, y + imgAreaY + imgY, imgW, imgH, cropX, cropY, zoomSteps[cropZoom].zoom, cropHandler.cropParams, (this == iarea->mainCropWindow), true, zoomSteps[cropZoom].zoom <= cropHandler.getFitZoom() ); + drawCrop (cr, x + imgAreaX + imgX, y + imgAreaY + imgY, imgW, imgH, cropX, cropY, zoomSteps[cropZoom].zoom, cropHandler.cropParams, (this == iarea->mainCropWindow), true, cropHandler.isFullDisplay ()); } if (observedCropWin) { @@ -1805,7 +1805,7 @@ void CropWindow::expose (Cairo::RefPtr cr) iarea->get_window()->draw_pixbuf (iarea->get_style()->get_base_gc(Gtk::STATE_NORMAL), rough, 0, 0, x + imgAreaX + imgX, y + imgAreaY + imgY, rtengine::min (rough->get_width (), imgAreaW-imgX), rtengine::min (rough->get_height (), imgAreaH-imgY), Gdk::RGB_DITHER_NORMAL, 0, 0); if (cropHandler.cropParams.enabled) { - drawCrop (cr, x + imgAreaX + imgX, y + imgAreaY + imgY, rough->get_width(), rough->get_height(), cropX, cropY, zoomSteps[cropZoom].zoom, cropHandler.cropParams, (this == iarea->mainCropWindow), true, zoomSteps[cropZoom].zoom <= cropHandler.getFitZoom()); + drawCrop (cr, x + imgAreaX + imgX, y + imgAreaY + imgY, rough->get_width(), rough->get_height(), cropX, cropY, zoomSteps[cropZoom].zoom, cropHandler.cropParams, (this == iarea->mainCropWindow), true, cropHandler.isFullDisplay ()); } if (observedCropWin) {