From 085931cb4fb7490ac360ec4918d81a24bc54e8ce Mon Sep 17 00:00:00 2001 From: Paul Kaplan Date: Mon, 30 Apr 2018 16:33:35 -0400 Subject: [PATCH] Scale the drawable scale by the ratio of pixel size to native size. This makes the vector sprites not blurry in fullscreen mode --- src/RenderWebGL.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/RenderWebGL.js b/src/RenderWebGL.js index ab3c606..2e0355f 100644 --- a/src/RenderWebGL.js +++ b/src/RenderWebGL.js @@ -1237,7 +1237,11 @@ class RenderWebGL extends EventEmitter { // the ignoreVisibility flag is used (e.g. for stamping or touchingColor). if (!drawable.getVisible() && !opts.ignoreVisibility) continue; - const drawableScale = drawable.scale; + // Combine drawable scale with the native vs. backing pixel ratio + const drawableScale = [ + drawable.scale[0] * this._gl.canvas.width / this._nativeSize[0], + drawable.scale[1] * this._gl.canvas.height / this._nativeSize[1] + ]; // If the skin or texture isn't ready yet, skip it. if (!drawable.skin || !drawable.skin.getTexture(drawableScale)) continue;