Fix file rotation problem in thumb browser, see issue #621
This commit is contained in:
parent
20384be856
commit
841fc32e3c
@ -212,8 +212,16 @@ void FileBrowserEntry::_updateImage (rtengine::IImage8* img, double s, rtengine:
|
|||||||
redrawRequests--;
|
redrawRequests--;
|
||||||
scale = s;
|
scale = s;
|
||||||
this->cropParams = cropParams;
|
this->cropParams = cropParams;
|
||||||
|
|
||||||
|
bool newLandscape = img->getWidth() > img->getHeight();
|
||||||
|
bool rotated=false;
|
||||||
|
|
||||||
if (preh == img->getHeight ()) {
|
if (preh == img->getHeight ()) {
|
||||||
prew = img->getWidth ();
|
prew = img->getWidth ();
|
||||||
|
|
||||||
|
// Check if image has been rotated since last time
|
||||||
|
rotated = preview!=NULL && newLandscape!=landscape;
|
||||||
|
|
||||||
guint8* temp = preview;
|
guint8* temp = preview;
|
||||||
preview = NULL;
|
preview = NULL;
|
||||||
delete [] temp;
|
delete [] temp;
|
||||||
@ -222,9 +230,17 @@ void FileBrowserEntry::_updateImage (rtengine::IImage8* img, double s, rtengine:
|
|||||||
preview = temp;
|
preview = temp;
|
||||||
updateBackBuffer ();
|
updateBackBuffer ();
|
||||||
}
|
}
|
||||||
if (redrawRequests==0 && parent)
|
|
||||||
parent->redrawNeeded (this);
|
landscape = newLandscape;
|
||||||
|
|
||||||
img->free ();
|
img->free ();
|
||||||
|
|
||||||
|
if (parent!=NULL) {
|
||||||
|
if (rotated)
|
||||||
|
parent->thumbRearrangementNeeded();
|
||||||
|
else if (redrawRequests==0)
|
||||||
|
parent->redrawNeeded (this);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool FileBrowserEntry::motionNotify (int x, int y) {
|
bool FileBrowserEntry::motionNotify (int x, int y) {
|
||||||
|
@ -48,6 +48,7 @@ class FileBrowserEntry : public ThumbBrowserEntryBase,
|
|||||||
ImageAreaToolListener* iatlistener;
|
ImageAreaToolListener* iatlistener;
|
||||||
int press_x, press_y, action_x, action_y;
|
int press_x, press_y, action_x, action_y;
|
||||||
double rot_deg;
|
double rot_deg;
|
||||||
|
bool landscape;
|
||||||
rtengine::procparams::CropParams cropParams;
|
rtengine::procparams::CropParams cropParams;
|
||||||
CropGUIListener* cropgl;
|
CropGUIListener* cropgl;
|
||||||
FileBrowserEntryIdleHelper* feih;
|
FileBrowserEntryIdleHelper* feih;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user