mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-29 07:42:04 +00:00
Bug 637852. Part 2: Add BaseRect::ScaleInverseRoundOut API. r=joe
This commit is contained in:
parent
29044a8c64
commit
ac135884a6
@ -305,6 +305,16 @@ struct BaseRect {
|
||||
width = right - x;
|
||||
height = bottom - y;
|
||||
}
|
||||
void ScaleInverseRoundOut(double aScale) { ScaleInverseRoundOut(aScale, aScale); }
|
||||
void ScaleInverseRoundOut(double aXScale, double aYScale)
|
||||
{
|
||||
T right = static_cast<T>(ceil(double(XMost()) / aXScale));
|
||||
T bottom = static_cast<T>(ceil(double(YMost()) / aYScale));
|
||||
x = static_cast<T>(floor(double(x) / aXScale));
|
||||
y = static_cast<T>(floor(double(y) / aYScale));
|
||||
width = right - x;
|
||||
height = bottom - y;
|
||||
}
|
||||
|
||||
private:
|
||||
// Do not use the default operator== or operator!= !
|
||||
|
Loading…
Reference in New Issue
Block a user