Fix random behaviour when opening images in SETM and 'Auto zoom to fit the crop area' is enabled, fixes #4357
This commit is contained in:
@@ -2577,7 +2577,7 @@ void CropWindow::initialImageArrived ()
|
|||||||
{
|
{
|
||||||
|
|
||||||
for (auto listener : listeners) {
|
for (auto listener : listeners) {
|
||||||
listener->initialImageArrived (this);
|
listener->initialImageArrived();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -40,7 +40,7 @@ public:
|
|||||||
virtual void cropPositionChanged (CropWindow*) {}
|
virtual void cropPositionChanged (CropWindow*) {}
|
||||||
virtual void cropWindowSizeChanged (CropWindow*) {}
|
virtual void cropWindowSizeChanged (CropWindow*) {}
|
||||||
virtual void cropZoomChanged (CropWindow*) {}
|
virtual void cropZoomChanged (CropWindow*) {}
|
||||||
virtual void initialImageArrived (CropWindow*) {}
|
virtual void initialImageArrived () {}
|
||||||
};
|
};
|
||||||
|
|
||||||
class ImageArea;
|
class ImageArea;
|
||||||
|
@@ -1068,7 +1068,6 @@ void EditorPanel::open (Thumbnail* tmb, rtengine::InitialImage* isrc)
|
|||||||
// since there was no resize event
|
// since there was no resize event
|
||||||
if (iareapanel->imageArea->mainCropWindow) {
|
if (iareapanel->imageArea->mainCropWindow) {
|
||||||
iareapanel->imageArea->mainCropWindow->cropHandler.newImage (ipc, false);
|
iareapanel->imageArea->mainCropWindow->cropHandler.newImage (ipc, false);
|
||||||
iareapanel->imageArea->mainCropWindow->initialImageArrived();
|
|
||||||
|
|
||||||
// In single tab mode, the image is not always updated between switches
|
// In single tab mode, the image is not always updated between switches
|
||||||
// normal redraw don't work, so this is the hard way
|
// normal redraw don't work, so this is the hard way
|
||||||
|
@@ -25,7 +25,7 @@
|
|||||||
#include "../rtengine/refreshmap.h"
|
#include "../rtengine/refreshmap.h"
|
||||||
#include "options.h"
|
#include "options.h"
|
||||||
|
|
||||||
ImageArea::ImageArea (ImageAreaPanel* p) : parent(p), firstOpen(true), fullImageWidth(0), fullImageHeight(0)
|
ImageArea::ImageArea (ImageAreaPanel* p) : parent(p), fullImageWidth(0), fullImageHeight(0)
|
||||||
{
|
{
|
||||||
|
|
||||||
infotext = "";
|
infotext = "";
|
||||||
@@ -633,33 +633,23 @@ void ImageArea::setZoom (double zoom)
|
|||||||
zoomPanel->refreshZoomLabel ();
|
zoomPanel->refreshZoomLabel ();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ImageArea::initialImageArrived (CropWindow* cw)
|
void ImageArea::initialImageArrived ()
|
||||||
{
|
{
|
||||||
|
|
||||||
if (mainCropWindow) {
|
if (mainCropWindow) {
|
||||||
if(firstOpen || options.prevdemo != PD_Sidecar || (!options.rememberZoomAndPan) ) {
|
int w, h;
|
||||||
|
mainCropWindow->cropHandler.getFullImageSize(w, h);
|
||||||
|
if(options.prevdemo != PD_Sidecar || !options.rememberZoomAndPan || w != fullImageWidth || h != fullImageHeight) {
|
||||||
if (options.cropAutoFit || options.bgcolor != 0) {
|
if (options.cropAutoFit || options.bgcolor != 0) {
|
||||||
mainCropWindow->zoomFitCrop();
|
mainCropWindow->zoomFitCrop();
|
||||||
} else {
|
} else {
|
||||||
mainCropWindow->zoomFit();
|
mainCropWindow->zoomFit();
|
||||||
}
|
}
|
||||||
firstOpen = false;
|
} else if ((options.cropAutoFit || options.bgcolor != 0) && mainCropWindow->cropHandler.cropParams.enabled) {
|
||||||
mainCropWindow->cropHandler.getFullImageSize(fullImageWidth, fullImageHeight);
|
mainCropWindow->zoomFitCrop();
|
||||||
} else {
|
|
||||||
int w, h;
|
|
||||||
mainCropWindow->cropHandler.getFullImageSize(w, h);
|
|
||||||
|
|
||||||
if(w != fullImageWidth || h != fullImageHeight) {
|
|
||||||
if (options.cropAutoFit) {
|
|
||||||
mainCropWindow->zoomFitCrop();
|
|
||||||
} else {
|
|
||||||
mainCropWindow->zoomFit();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fullImageWidth = w;
|
|
||||||
fullImageHeight = h;
|
|
||||||
}
|
}
|
||||||
|
fullImageWidth = w;
|
||||||
|
fullImageHeight = h;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -65,7 +65,6 @@ protected:
|
|||||||
void get_preferred_height_for_width_vfunc (int width, int &minimum_height, int &natural_height) const;
|
void get_preferred_height_for_width_vfunc (int width, int &minimum_height, int &natural_height) const;
|
||||||
void get_preferred_width_for_height_vfunc (int height, int &minimum_width, int &natural_width) const;
|
void get_preferred_width_for_height_vfunc (int height, int &minimum_width, int &natural_width) const;
|
||||||
|
|
||||||
bool firstOpen;
|
|
||||||
int fullImageWidth, fullImageHeight;
|
int fullImageWidth, fullImageHeight;
|
||||||
public:
|
public:
|
||||||
CropWindow* mainCropWindow;
|
CropWindow* mainCropWindow;
|
||||||
@@ -148,7 +147,7 @@ public:
|
|||||||
void cropPositionChanged (CropWindow* cw);
|
void cropPositionChanged (CropWindow* cw);
|
||||||
void cropWindowSizeChanged (CropWindow* cw);
|
void cropWindowSizeChanged (CropWindow* cw);
|
||||||
void cropZoomChanged (CropWindow* cw);
|
void cropZoomChanged (CropWindow* cw);
|
||||||
void initialImageArrived (CropWindow* cw) ;
|
void initialImageArrived ();
|
||||||
|
|
||||||
// LockablePickerToolListener interface
|
// LockablePickerToolListener interface
|
||||||
void switchPickerVisibility (bool isVisible);
|
void switchPickerVisibility (bool isVisible);
|
||||||
|
Reference in New Issue
Block a user