Skip to content

Commit 7807a50

Browse files
committed
[melonjs#781] fix the WebGL renderer clearRect method
that was an easy peasy one after the changes made these last few days
1 parent 70d7084 commit 7807a50

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

CHANGELOG

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Version History
1313
* WebGLRenderer : optimized memory usage for shape drawing operations
1414
* WebGLRenderer : enable batching of triangle vertices to speed up shape drawing (when applicable)
1515
* WebGLRenderer : fixed a clipping issue with nested containers
16+
* WebGLRenderer : fixed the clearRect method
1617

1718
6.2.0
1819
* Audio : fixed a regression when passing an initial volume value to the play function (thanks @PLAYERKILLERS)

src/video/canvas/canvas_renderer.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,7 @@
159159
},
160160

161161
/**
162-
* Sets all pixels in the given rectangle to transparent black, <br>
163-
* erasing any previously drawn content.
162+
* Erase the pixels in the given rectangular area by setting them to transparent black (rgba(0,0,0,0)).
164163
* @name clearRect
165164
* @memberOf me.CanvasRenderer
166165
* @function

src/video/webgl/webgl_renderer.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -232,8 +232,7 @@
232232
},
233233

234234
/**
235-
* Sets all pixels in the given rectangle to transparent black,
236-
* erasing any previously drawn content.
235+
* Erase the pixels in the given rectangular area by setting them to transparent black (rgba(0,0,0,0)).
237236
* @name clearRect
238237
* @memberOf me.WebGLRenderer
239238
* @function
@@ -244,7 +243,7 @@
244243
*/
245244
clearRect : function (x, y, width, height) {
246245
var color = this.currentColor.clone();
247-
this.currentColor.copy("#0000");
246+
this.currentColor.copy("#000000");
248247
this.fillRect(x, y, width, height);
249248
this.currentColor.copy(color);
250249
me.pool.push(color);

0 commit comments

Comments
 (0)