mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 812899 part 1. Split the "image is overflow" concept in ImageDocument into two separate booleans for vertical and horizontal overflow. r=khuey
This commit is contained in:
parent
5fd2f2accc
commit
f155474462
@ -413,7 +413,7 @@ ImageDocument::RestoreImage()
|
||||
imageContent->UnsetAttr(kNameSpaceID_None, nsGkAtoms::width, true);
|
||||
imageContent->UnsetAttr(kNameSpaceID_None, nsGkAtoms::height, true);
|
||||
|
||||
if (mImageIsOverflowing) {
|
||||
if (ImageIsOverflowing()) {
|
||||
SetModeClass(eOverflowing);
|
||||
}
|
||||
else {
|
||||
@ -441,7 +441,7 @@ ImageDocument::ToggleImageSize()
|
||||
ResetZoomLevel();
|
||||
RestoreImage();
|
||||
}
|
||||
else if (mImageIsOverflowing) {
|
||||
else if (ImageIsOverflowing()) {
|
||||
ResetZoomLevel();
|
||||
ShrinkToFit();
|
||||
}
|
||||
@ -579,7 +579,7 @@ ImageDocument::HandleEvent(nsIDOMEvent* aEvent)
|
||||
mShouldResize = false;
|
||||
RestoreImageTo(x, y);
|
||||
}
|
||||
else if (mImageIsOverflowing) {
|
||||
else if (ImageIsOverflowing()) {
|
||||
ShrinkToFit();
|
||||
}
|
||||
} else if (eventType.EqualsLiteral("load")) {
|
||||
@ -681,14 +681,14 @@ ImageDocument::CheckOverflowing(bool changeState)
|
||||
mVisibleHeight = nsPresContext::AppUnitsToFloatCSSPixels(visibleArea.height);
|
||||
}
|
||||
|
||||
bool imageWasOverflowing = mImageIsOverflowing;
|
||||
mImageIsOverflowing =
|
||||
mImageWidth > mVisibleWidth || mImageHeight > mVisibleHeight;
|
||||
bool windowBecameBigEnough = imageWasOverflowing && !mImageIsOverflowing;
|
||||
bool imageWasOverflowing = ImageIsOverflowing();
|
||||
mImageIsOverflowingHorizontally = mImageWidth > mVisibleWidth;
|
||||
mImageIsOverflowingVertically = mImageHeight > mVisibleHeight;
|
||||
bool windowBecameBigEnough = imageWasOverflowing && !ImageIsOverflowing();
|
||||
|
||||
if (changeState || mShouldResize || mFirstResize ||
|
||||
windowBecameBigEnough) {
|
||||
if (mImageIsOverflowing && (changeState || mShouldResize)) {
|
||||
if (ImageIsOverflowing() && (changeState || mShouldResize)) {
|
||||
ShrinkToFit();
|
||||
}
|
||||
else if (mImageIsResized || mFirstResize || windowBecameBigEnough) {
|
||||
|
@ -62,7 +62,7 @@ public:
|
||||
}
|
||||
bool ImageIsOverflowing() const
|
||||
{
|
||||
return mImageIsOverflowing;
|
||||
return mImageIsOverflowingHorizontally || mImageIsOverflowingVertically;
|
||||
}
|
||||
bool ImageIsResized() const
|
||||
{
|
||||
@ -118,7 +118,8 @@ protected:
|
||||
|
||||
bool mResizeImageByDefault;
|
||||
bool mClickResizingEnabled;
|
||||
bool mImageIsOverflowing;
|
||||
bool mImageIsOverflowingHorizontally;
|
||||
bool mImageIsOverflowingVertically;
|
||||
// mImageIsResized is true if the image is currently resized
|
||||
bool mImageIsResized;
|
||||
// mShouldResize is true if the image should be resized when it doesn't fit
|
||||
|
Loading…
Reference in New Issue
Block a user