mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-01 17:23:59 +00:00
Bug 1375232 - Snap window transforms that are translations. r=spohl
MozReview-Commit-ID: Jelbo3IraxR --HG-- extra : rebase_source : 456c39867247993022233a95f518c6328223cbff
This commit is contained in:
parent
56bd8d22b1
commit
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.
|
||||
|
Loading…
Reference in New Issue
Block a user