зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1375232 - Snap window transforms that are translations. r=spohl
MozReview-Commit-ID: Jelbo3IraxR --HG-- extra : rebase_source : 456c39867247993022233a95f518c6328223cbff
This commit is contained in:
Родитель
56bd8d22b1
Коммит
b551842590
|
@ -2268,6 +2268,14 @@ nsCocoaWindow::SetWindowTransform(const gfx::Matrix& aTransform)
|
|||
|
||||
transform.PreTranslate(-mBounds.x, -mBounds.y);
|
||||
|
||||
// Snap translations to device pixels, to match what we do for CSS transforms
|
||||
// and because the window server rounds down instead of to nearest.
|
||||
if (!transform.HasNonTranslation() && transform.HasNonIntegerTranslation()) {
|
||||
auto snappedTranslation = gfx::IntPoint::Round(transform.GetTranslation());
|
||||
transform = gfx::Matrix::Translation(snappedTranslation.x,
|
||||
snappedTranslation.y);
|
||||
}
|
||||
|
||||
// We also need to account for the backing scale factor: aTransform is given
|
||||
// in device pixels, but CGSSetWindowTransform works with logical display
|
||||
// pixels.
|
||||
|
|
Загрузка…
Ссылка в новой задаче