Bug 1165900 - Make MaybeSnapToDevicePixels return a boolean to indicate whether snapping occurred. r=Bas

This commit is contained in:
Jonathan Watt 2015-05-06 14:43:56 +01:00
parent 3af6ce5868
commit 737bb25dd5

View File

@ -361,7 +361,7 @@ inline bool UserToDevicePixelSnapped(Rect& aRect, const DrawTarget& aDrawTarget,
* This function has the same behavior as UserToDevicePixelSnapped except that
* aRect is not transformed to device space.
*/
inline void MaybeSnapToDevicePixels(Rect& aRect, const DrawTarget& aDrawTarget,
inline bool MaybeSnapToDevicePixels(Rect& aRect, const DrawTarget& aDrawTarget,
bool aAllowScaleOr90DegreeRotate = false)
{
if (UserToDevicePixelSnapped(aRect, aDrawTarget,
@ -371,7 +371,9 @@ inline void MaybeSnapToDevicePixels(Rect& aRect, const DrawTarget& aDrawTarget,
Matrix mat = aDrawTarget.GetTransform();
mat.Invert();
aRect = mat.TransformBounds(aRect);
return true;
}
return false;
}
} // namespace gfx