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
This commit is contained in:
@@ -535,7 +535,8 @@ ShowImageView::AlignBitmap()
|
|||||||
width = Bounds().Width()-2*PEN_SIZE+1;
|
width = Bounds().Width()-2*PEN_SIZE+1;
|
||||||
height = Bounds().Height()-2*PEN_SIZE+1;
|
height = Bounds().Height()-2*PEN_SIZE+1;
|
||||||
if (width == 0 || height == 0) return rect;
|
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();
|
fZoomToBounds && rect.Width() < Bounds().Width() && rect.Height() < Bounds().Height();
|
||||||
if (fShrinkOrZoomToBounds) {
|
if (fShrinkOrZoomToBounds) {
|
||||||
float s;
|
float s;
|
||||||
@@ -554,9 +555,16 @@ ShowImageView::AlignBitmap()
|
|||||||
rect.OffsetBy(static_cast<int>((width - rect.Width()) / 2), 0);
|
rect.OffsetBy(static_cast<int>((width - rect.Width()) / 2), 0);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
float zoom;
|
||||||
|
if (fShrinkToBounds || fZoomToBounds) {
|
||||||
|
// ignore user zoom setting in automatic zoom modes
|
||||||
|
zoom = 1.0;
|
||||||
|
} else {
|
||||||
|
zoom = fZoom;
|
||||||
|
}
|
||||||
// zoom image
|
// zoom image
|
||||||
rect.right = static_cast<int>((rect.right+1.0)*fZoom)-1;
|
rect.right = static_cast<int>((rect.right+1.0)*zoom)-1;
|
||||||
rect.bottom = static_cast<int>((rect.bottom+1.0)*fZoom)-1;
|
rect.bottom = static_cast<int>((rect.bottom+1.0)*zoom)-1;
|
||||||
// align
|
// align
|
||||||
switch (fHAlignment) {
|
switch (fHAlignment) {
|
||||||
case B_ALIGN_CENTER:
|
case B_ALIGN_CENTER:
|
||||||
|
|||||||
Reference in New Issue
Block a user