From 2eb8ebcdbcf0a50fed1acda630398bad547d5e27 Mon Sep 17 00:00:00 2001 From: Alexander Ivash Date: Fri, 16 Feb 2018 19:59:42 +0300 Subject: [PATCH] FB11508 - toolbar slowly sides downward --- interface/resources/qml/windows/Window.qml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/interface/resources/qml/windows/Window.qml b/interface/resources/qml/windows/Window.qml index a0ef73290a..4ed765db4b 100644 --- a/interface/resources/qml/windows/Window.qml +++ b/interface/resources/qml/windows/Window.qml @@ -89,6 +89,15 @@ Fadable { window.shown = value; } + // used to snap window content to pixel by translating content by negative fractional part of the x/y + // thus if x was 5.41, snapper's x will be -0.41 + // avoiding fractional window position is to avoid artifacts in text rendering when the fractional positions are present. + transform: Translate { + id: snapper + x: 0; + y: 0; + } + property var rectifier: Timer { property bool executing: false; interval: 100 @@ -97,8 +106,8 @@ Fadable { onTriggered: { executing = true; - x = Math.floor(x); - y = Math.floor(y); + snapper.x = Math.floor(x) - x; + snapper.y = Math.floor(y) - y; executing = false; }