From a8138a6e119d08a8d01deb2b83c6bb80d964b5fd Mon Sep 17 00:00:00 2001 From: Michael Pfeiffer Date: Sat, 10 Jan 2004 09:29:13 +0000 Subject: [PATCH] Bug fixed: ignore user zoom setting in automatic zoom modes. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6000 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/apps/showimage/ShowImageView.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/apps/showimage/ShowImageView.cpp b/src/apps/showimage/ShowImageView.cpp index 25dd45315d..8ba6bd4690 100644 --- a/src/apps/showimage/ShowImageView.cpp +++ b/src/apps/showimage/ShowImageView.cpp @@ -535,7 +535,8 @@ ShowImageView::AlignBitmap() width = Bounds().Width()-2*PEN_SIZE+1; height = Bounds().Height()-2*PEN_SIZE+1; if (width == 0 || height == 0) return rect; - fShrinkOrZoomToBounds = fShrinkToBounds && (rect.Width() >= Bounds().Width() || rect.Height() >= Bounds().Height()) || + fShrinkOrZoomToBounds = fShrinkToBounds && + (rect.Width() >= Bounds().Width() || rect.Height() >= Bounds().Height()) || fZoomToBounds && rect.Width() < Bounds().Width() && rect.Height() < Bounds().Height(); if (fShrinkOrZoomToBounds) { float s; @@ -554,9 +555,16 @@ ShowImageView::AlignBitmap() rect.OffsetBy(static_cast((width - rect.Width()) / 2), 0); } } else { + float zoom; + if (fShrinkToBounds || fZoomToBounds) { + // ignore user zoom setting in automatic zoom modes + zoom = 1.0; + } else { + zoom = fZoom; + } // zoom image - rect.right = static_cast((rect.right+1.0)*fZoom)-1; - rect.bottom = static_cast((rect.bottom+1.0)*fZoom)-1; + rect.right = static_cast((rect.right+1.0)*zoom)-1; + rect.bottom = static_cast((rect.bottom+1.0)*zoom)-1; // align switch (fHAlignment) { case B_ALIGN_CENTER: