mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-06-02 05:10:53 +02:00
Merge pull request #12426 from ElderOrb/FB11508
fix for toolbar slowly drifting on switching between HMD/Desktop modes
This commit is contained in:
commit
aa67a98d02
1 changed files with 11 additions and 2 deletions
|
@ -89,6 +89,15 @@ Fadable {
|
||||||
window.shown = value;
|
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 var rectifier: Timer {
|
||||||
property bool executing: false;
|
property bool executing: false;
|
||||||
interval: 100
|
interval: 100
|
||||||
|
@ -97,8 +106,8 @@ Fadable {
|
||||||
|
|
||||||
onTriggered: {
|
onTriggered: {
|
||||||
executing = true;
|
executing = true;
|
||||||
x = Math.floor(x);
|
snapper.x = Math.floor(x) - x;
|
||||||
y = Math.floor(y);
|
snapper.y = Math.floor(y) - y;
|
||||||
executing = false;
|
executing = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue