mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-17 07:15:46 +00:00
Bug 1393272 - Use original width and height if either the scaled width or height is 0. r=jya
MozReview-Commit-ID: 3y4c5zJZD0a --HG-- extra : rebase_source : ec0d168f544be8dea1cbf63d9b2c253ea139286c
This commit is contained in:
parent
4a8b35e00c
commit
58868278cc
@ -289,11 +289,18 @@ public:
|
||||
!mImage.height) {
|
||||
return ImageRect();
|
||||
}
|
||||
|
||||
gfx::IntRect imageRect = ImageRect();
|
||||
int64_t w = (aWidth * imageRect.Width()) / mImage.width;
|
||||
int64_t h = (aHeight * imageRect.Height()) / mImage.height;
|
||||
if (!w || !h) {
|
||||
return imageRect;
|
||||
}
|
||||
|
||||
imageRect.x = (imageRect.x * aWidth) / mImage.width;
|
||||
imageRect.y = (imageRect.y * aHeight) / mImage.height;
|
||||
imageRect.SetWidth((aWidth * imageRect.Width()) / mImage.width);
|
||||
imageRect.SetHeight((aHeight * imageRect.Height()) / mImage.height);
|
||||
imageRect.SetWidth(w);
|
||||
imageRect.SetHeight(h);
|
||||
return imageRect;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user