diff options
author | Gunnar Sletta <gunnar@sletta.org> | 2014-10-23 11:28:22 +0200 |
---|---|---|
committer | Gunnar Sletta <gunnar@sletta.org> | 2014-10-23 12:06:57 +0200 |
commit | 6e883c535b91c55289d54aa639199ca0a4decaec (patch) | |
tree | 05903e82d27339da160c4ba0ea8030a9d1b8618c /src/quick/scenegraph/shaders/styledtext_core.vert | |
parent | e3c6f39734ff54b2d7425f2edaaf6033ef2b1d9e (diff) |
Fix pixelgrid snapping of native text on retina displays.
Change 63e6c9ada82dc8f16e705cef5f89292784b7ace4 introduced snapping to
the pixel grid in the vertex shader for native text, but this code was
broken on retina displays because it assumed integer only positions.
Fix it by including the retina scale factor into the rounding.
Task-number: QTBUG-38702
Change-Id: I84492b02d64f263c9fe030790e04cf79b0dc4e2f
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
Diffstat (limited to 'src/quick/scenegraph/shaders/styledtext_core.vert')
-rw-r--r-- | src/quick/scenegraph/shaders/styledtext_core.vert | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/quick/scenegraph/shaders/styledtext_core.vert b/src/quick/scenegraph/shaders/styledtext_core.vert index 65bdb66814..c522877bb3 100644 --- a/src/quick/scenegraph/shaders/styledtext_core.vert +++ b/src/quick/scenegraph/shaders/styledtext_core.vert @@ -9,10 +9,11 @@ out vec2 shiftedSampleCoord; uniform mat4 matrix; uniform vec2 textureScale; uniform vec2 shift; +uniform float dpr; void main() { sampleCoord = tCoord * textureScale; shiftedSampleCoord = (tCoord - shift) * textureScale; - gl_Position = matrix * round(vCoord); + gl_Position = matrix * round(vCoord * dpr) / dpr; } |