зеркало из https://github.com/mozilla/pjs.git
Bug 382595: Lines across embedded svg when scrolling. Followup rounding fix. r+sr=roc
This commit is contained in:
Родитель
0d431370ee
Коммит
b510ef0af3
|
@ -165,9 +165,9 @@ struct NS_GFX nsRect {
|
|||
// Scale by aScale, converting coordinates to integers so that the result
|
||||
// is the larges integer-coordinate rectangle contained in the unrounded result
|
||||
nsRect& ScaleRoundIn(float aScale);
|
||||
// Scale by aScale, converting coordinates to integers so that the result
|
||||
// contains the same pixel centers as the unrounded result
|
||||
nsRect& ScaleRoundPreservingCenters(float aScale);
|
||||
// Scale by the inverse of aScale, converting coordinates to integers so that
|
||||
// the result contains the same pixel centers as the unrounded result
|
||||
nsRect& ScaleRoundPreservingCentersInverse(float aScale);
|
||||
|
||||
// Helpers for accessing the vertices
|
||||
nsPoint TopLeft() const { return nsPoint(x, y); }
|
||||
|
|
|
@ -204,12 +204,12 @@ nsRect& nsRect::ScaleRoundIn(float aScale)
|
|||
return *this;
|
||||
}
|
||||
|
||||
nsRect& nsRect::ScaleRoundPreservingCenters(float aScale)
|
||||
nsRect& nsRect::ScaleRoundPreservingCentersInverse(float aScale)
|
||||
{
|
||||
nscoord right = NSToCoordRound(float(XMost()) * aScale);
|
||||
nscoord bottom = NSToCoordRound(float(YMost()) * aScale);
|
||||
x = NSToCoordRound(float(x) * aScale);
|
||||
y = NSToCoordRound(float(y) * aScale);
|
||||
nscoord right = NSToCoordRound(float(XMost()) / aScale);
|
||||
nscoord bottom = NSToCoordRound(float(YMost()) / aScale);
|
||||
x = NSToCoordRound(float(x) / aScale);
|
||||
y = NSToCoordRound(float(y) / aScale);
|
||||
width = (right - x);
|
||||
height = (bottom - y);
|
||||
return *this;
|
||||
|
|
|
@ -358,7 +358,7 @@ nsRect nsView::CalcWidgetBounds(nsWindowType aType)
|
|||
}
|
||||
|
||||
nsRect newBounds(viewBounds);
|
||||
newBounds.ScaleRoundPreservingCenters(1.0f / p2a);
|
||||
newBounds.ScaleRoundPreservingCentersInverse(p2a);
|
||||
|
||||
nsPoint roundedOffset(NSIntPixelsToAppUnits(newBounds.x, p2a),
|
||||
NSIntPixelsToAppUnits(newBounds.y, p2a));
|
||||
|
|
Загрузка…
Ссылка в новой задаче