From d0405baf86117029a9bf4301acf002dc87df523f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Fri, 19 Nov 2010 21:57:31 +0000 Subject: [PATCH] * Fixed #3042 as suggested by Stippi (looks like I'm quickly following Ingo's great example at getting senile - at least he told me about this solution before; the same trick is already used in SetZoom()). git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39527 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/apps/showimage/ShowImageView.cpp | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/src/apps/showimage/ShowImageView.cpp b/src/apps/showimage/ShowImageView.cpp index 67738b6a66..fd6716b1f8 100644 --- a/src/apps/showimage/ShowImageView.cpp +++ b/src/apps/showimage/ShowImageView.cpp @@ -376,8 +376,7 @@ ShowImageView::SetImage(const entry_ref* ref, BBitmap* bitmap) // prepare the display bitmap if (fBitmap->ColorSpace() == B_RGBA32) fDisplayBitmap = compose_checker_background(fBitmap); - - if (!fDisplayBitmap) + if (fDisplayBitmap == NULL) fDisplayBitmap = fBitmap; BNode node(ref); @@ -1210,23 +1209,12 @@ ShowImageView::_ScrollRestricted(float x, float y, bool absolute) if (y != 0) y = _LimitToRange(y, B_VERTICAL, absolute); - // hide the caption when using mouse wheel - // in full screen mode - // to prevent the caption from dirtying up the image - // during scrolling. - bool caption = fShowCaption; - if (caption) { - fShowCaption = false; - _UpdateCaption(); - } + // We invalidate before we scroll to avoid the caption messing up the + // image, and to prevent it from flickering + if (fShowCaption) + Invalidate(); ScrollBy(x, y); - - if (caption) { - // show the caption again - fShowCaption = true; - _UpdateCaption(); - } }