From f9ff8925104991567b3cda8a6a6409cc4e292afe Mon Sep 17 00:00:00 2001 From: photonstorm Date: Mon, 4 Apr 2016 21:21:23 +0100 Subject: [PATCH] Formatting. --- README.md | 1 + src/gameobjects/Text.js | 1 + src/pixi/renderers/canvas/CanvasRenderer.js | 15 ++++++--------- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 8363a7d4f..1a0332726 100644 --- a/README.md +++ b/README.md @@ -335,6 +335,7 @@ You can read all about the philosophy behind Lazer [here](http://phaser.io/news/ * The Tiled parser only supports un-compressed layer data. Previously it would silently fail, now it detects if layer compression is used and displays a console warning instead (thanks @MannyC #2413) * The Tiled parser now removes the `encoding` parameter so that a subsequent process doesn't try to decode the data again (thanks @MannyC #2412) * Ensure a parent container is a Group before removing from its hash (thanks @rblopes #2397) +* PIXI.CanvasRenderer.resize now applies the `renderSession.smoothProperty` to the Canvas context when it resizes. This should help with unwanted canvas smoothing (thanks @sergey7c4 #2395 #2317) ### Bug Fixes diff --git a/src/gameobjects/Text.js b/src/gameobjects/Text.js index cfa933aa3..f123b27b4 100644 --- a/src/gameobjects/Text.js +++ b/src/gameobjects/Text.js @@ -375,6 +375,7 @@ Phaser.Text.prototype.updateText = function () { var fontProperties = this.determineFontProperties(this.style.font); var drawnLines = lines.length; + if (this.style.maxLines > 0 && this.style.maxLines < lines.length) { drawnLines = this.style.maxLines; diff --git a/src/pixi/renderers/canvas/CanvasRenderer.js b/src/pixi/renderers/canvas/CanvasRenderer.js index 7842504d9..8be302eb1 100644 --- a/src/pixi/renderers/canvas/CanvasRenderer.js +++ b/src/pixi/renderers/canvas/CanvasRenderer.js @@ -107,10 +107,6 @@ PIXI.CanvasRenderer = function (game) { */ this.refresh = true; - // This is already done in the Game.setUpRenderer method. - // this.view.width = this.width * this.resolution; - // this.view.height = this.height * this.resolution; - /** * Internal var. * @@ -199,8 +195,8 @@ PIXI.CanvasRenderer.prototype.render = function (stage) { * @method destroy * @param [removeView=true] {boolean} Removes the Canvas element from the DOM. */ -PIXI.CanvasRenderer.prototype.destroy = function(removeView) -{ +PIXI.CanvasRenderer.prototype.destroy = function (removeView) { + if (removeView === undefined) { removeView = true; } if (removeView && this.view.parent) @@ -222,8 +218,8 @@ PIXI.CanvasRenderer.prototype.destroy = function(removeView) * @param width {Number} the new width of the canvas view * @param height {Number} the new height of the canvas view */ -PIXI.CanvasRenderer.prototype.resize = function(width, height) -{ +PIXI.CanvasRenderer.prototype.resize = function (width, height) { + this.width = width * this.resolution; this.height = height * this.resolution; @@ -236,10 +232,11 @@ PIXI.CanvasRenderer.prototype.resize = function(width, height) this.view.style.height = this.height / this.resolution + "px"; } - if(this.renderSession.smoothProperty) + if (this.renderSession.smoothProperty) { this.context[this.renderSession.smoothProperty] = (this.renderSession.scaleMode === PIXI.scaleModes.LINEAR); } + }; /**