Fix file rotation problem in thumb browser, see issue #621

This commit is contained in:
Oliver Duis 2011-04-29 18:57:45 +02:00
parent 20384be856
commit 841fc32e3c
2 changed files with 19 additions and 2 deletions

View File

@ -212,8 +212,16 @@ void FileBrowserEntry::_updateImage (rtengine::IImage8* img, double s, rtengine:
redrawRequests--;
scale = s;
this->cropParams = cropParams;
bool newLandscape = img->getWidth() > img->getHeight();
bool rotated=false;
if (preh == img->getHeight ()) {
prew = img->getWidth ();
// Check if image has been rotated since last time
rotated = preview!=NULL && newLandscape!=landscape;
guint8* temp = preview;
preview = NULL;
delete [] temp;
@ -222,9 +230,17 @@ void FileBrowserEntry::_updateImage (rtengine::IImage8* img, double s, rtengine:
preview = temp;
updateBackBuffer ();
}
if (redrawRequests==0 && parent)
parent->redrawNeeded (this);
landscape = newLandscape;
img->free ();
if (parent!=NULL) {
if (rotated)
parent->thumbRearrangementNeeded();
else if (redrawRequests==0)
parent->redrawNeeded (this);
}
}
bool FileBrowserEntry::motionNotify (int x, int y) {

View File

@ -48,6 +48,7 @@ class FileBrowserEntry : public ThumbBrowserEntryBase,
ImageAreaToolListener* iatlistener;
int press_x, press_y, action_x, action_y;
double rot_deg;
bool landscape;
rtengine::procparams::CropParams cropParams;
CropGUIListener* cropgl;
FileBrowserEntryIdleHelper* feih;