From fb539ea10a7171f974df868b065aa0c1c49ba7ec Mon Sep 17 00:00:00 2001 From: -=yb4f310 Date: Fri, 9 Mar 2018 12:45:57 +0100 Subject: [PATCH] resize bullshit --- src/game-lib-renderer-d3.js | 7 +++++-- src/game-lib-system-render.js | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/game-lib-renderer-d3.js b/src/game-lib-renderer-d3.js index 23f74dd..c5db8cf 100644 --- a/src/game-lib-renderer-d3.js +++ b/src/game-lib-renderer-d3.js @@ -417,11 +417,14 @@ GameLib.Renderer.D3.prototype.clear = function() { * @param height */ GameLib.Renderer.D3.prototype.setSize = function(width, height) { + this.instance.setSize( - this.width * data.width, - this.height * data.height, + this.width * width, + this.height * height, false ); + + this.instance.setPixelRatio(window.devicePixelRatio); }; /** diff --git a/src/game-lib-system-render.js b/src/game-lib-system-render.js index fda3ea3..878294f 100644 --- a/src/game-lib-system-render.js +++ b/src/game-lib-system-render.js @@ -58,7 +58,7 @@ GameLib.System.Render.prototype.start = function() { this.renderConfigurations = GameLib.EntityManager.Instance.queryComponents(GameLib.Component.RENDER_CONFIGURATION); - this.renderers = GameLib.EntityManager.Instance.queryComponents(GameLib.Component.RENDERER); + this.renderers = GameLib.EntityManager.Instance.queryComponentsByConstructor(GameLib.Renderer); this.composers = GameLib.EntityManager.Instance.queryComponents(GameLib.Component.COMPOSER); @@ -235,7 +235,7 @@ GameLib.System.Render.prototype.windowResize = function(data) { } ); - GameLib.EntityManager.Instance.queryComponents(GameLib.Component.RENDERER).map( + GameLib.EntityManager.Instance.queryComponentsByConstructor(GameLib.Renderer).map( function(renderer) { renderer.setSize(data.width, data.height); }