From 3266e0976ff055aefa49b664966229bbb89d1009 Mon Sep 17 00:00:00 2001 From: Andy Date: Fri, 31 Jul 2020 13:01:18 -0700 Subject: Issue #1619 - Convert Intrinsic Ratio to Float https://bugzilla.mozilla.org/show_bug.cgi?id=1547792 Aspect Ratio handling simplified by using floating point integers: - Multiplication of value (or inverse value) to a known side for Scaling - No unequal equal values such as "4/3" vs "8/6" vs "20/15" - Truly "Empty" aspect ratios, even if one dimension is not 0 --- image/RasterImage.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'image/RasterImage.cpp') diff --git a/image/RasterImage.cpp b/image/RasterImage.cpp index b67ec3bef..5725aee3a 100644 --- a/image/RasterImage.cpp +++ b/image/RasterImage.cpp @@ -240,13 +240,14 @@ RasterImage::GetIntrinsicSize(nsSize* aSize) //****************************************************************************** NS_IMETHODIMP -RasterImage::GetIntrinsicRatio(nsSize* aRatio) +RasterImage::GetIntrinsicRatio(AspectRatio* aRatio) { if (mError) { return NS_ERROR_FAILURE; } - *aRatio = nsSize(mSize.width, mSize.height); + *aRatio = AspectRatio::FromSize(mSize); + return NS_OK; } -- cgit v1.2.3