Skip to content

Commit 26cc845

Browse files
committed
The CanvasRenderer.BlitImage function has been removed, as has the associated blitImage property from the Canvas Renderer as they're no longer used.
1 parent fbb67ac commit 26cc845

4 files changed

Lines changed: 20 additions & 60 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ The Tile Sprite Game Object has been given an internal overhaul to make it more
140140
* You can now specify the `lineHeight` of a Retro Font in the Retro Font Config object (thanks @FelixNemis)
141141
* When a Static Tilemap Layer is generated in WebGL it will use the Cameras `roundPixels` value to clamp the tile coordinates.
142142
* The `CanvasRenderer.DrawImage` function has been removed, as has the associated `drawImage` property from the Canvas Renderer as they're no longer used.
143+
* The `CanvasRenderer.BlitImage` function has been removed, as has the associated `blitImage` property from the Canvas Renderer as they're no longer used.
143144

144145
### Game Config Resolution Specific Bug Fixes
145146

src/gameobjects/blitter/BlitterCanvasRenderer.js

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ var BlitterCanvasRenderer = function (renderer, src, interpolationPercentage, ca
5151
parentMatrix.copyToContext(ctx);
5252
}
5353

54+
var roundPixels = camera.roundPixels;
55+
5456
// Render bobs
5557
for (var i = 0; i < list.length; i++)
5658
{
@@ -74,7 +76,23 @@ var BlitterCanvasRenderer = function (renderer, src, interpolationPercentage, ca
7476

7577
if (!flip)
7678
{
77-
renderer.blitImage(dx + bob.x + cameraScrollX, dy + bob.y + cameraScrollY, bob.frame);
79+
if (roundPixels)
80+
{
81+
dx |= 0;
82+
dy |= 0;
83+
}
84+
85+
ctx.drawImage(
86+
frame.source.image,
87+
cd.x,
88+
cd.y,
89+
cd.width,
90+
cd.height,
91+
dx + bob.x + cameraScrollX,
92+
dy + bob.y + cameraScrollY,
93+
cd.width,
94+
cd.height
95+
);
7896
}
7997
else
8098
{

src/renderer/canvas/CanvasRenderer.js

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -129,15 +129,6 @@ var CanvasRenderer = new Class({
129129
*/
130130
this.currentContext = this.gameContext;
131131

132-
/**
133-
* [description]
134-
*
135-
* @name Phaser.Renderer.Canvas.CanvasRenderer#blitImage
136-
* @type {function}
137-
* @since 3.0.0
138-
*/
139-
this.blitImage = BlitImage(this.config.roundPixels);
140-
141132
/**
142133
* [description]
143134
*

src/renderer/canvas/utils/BlitImage.js

Lines changed: 0 additions & 50 deletions
This file was deleted.

0 commit comments

Comments
 (0)