mirror of
https://github.com/photonstorm/phaser
synced 2024-11-16 09:48:18 +00:00
Fixed issue with textureLine creating white blocks in iOS.
This commit is contained in:
parent
f2aa263d0a
commit
08c6106c35
2 changed files with 21 additions and 6 deletions
|
@ -314,8 +314,8 @@ Phaser.FlexGrid.prototype = {
|
||||||
this.game.debug.text(this.boundsFluid.width + ' x ' + this.boundsFluid.height, this.boundsFluid.x + 4, this.boundsFluid.y + 16);
|
this.game.debug.text(this.boundsFluid.width + ' x ' + this.boundsFluid.height, this.boundsFluid.x + 4, this.boundsFluid.y + 16);
|
||||||
this.game.debug.geom(this.boundsFluid, 'rgba(255,0,0,0.9', false);
|
this.game.debug.geom(this.boundsFluid, 'rgba(255,0,0,0.9', false);
|
||||||
|
|
||||||
this.game.debug.text(this.boundsNone.width + ' x ' + this.boundsNone.height, this.boundsNone.x + 4, this.boundsNone.y + 16);
|
// this.game.debug.text(this.boundsNone.width + ' x ' + this.boundsNone.height, this.boundsNone.x + 4, this.boundsNone.y + 16);
|
||||||
this.game.debug.geom(this.boundsNone, 'rgba(0,255,0,0.9', false);
|
// this.game.debug.geom(this.boundsNone, 'rgba(0,255,0,0.9', false);
|
||||||
|
|
||||||
// this.game.debug.text(this.boundsCustom.width + ' x ' + this.boundsCustom.height, this.boundsCustom.x + 4, this.boundsCustom.y + 16);
|
// this.game.debug.text(this.boundsCustom.width + ' x ' + this.boundsCustom.height, this.boundsCustom.x + 4, this.boundsCustom.y + 16);
|
||||||
// this.game.debug.geom(this.boundsCustom, 'rgba(255,255,0,0.9', false);
|
// this.game.debug.geom(this.boundsCustom, 'rgba(255,255,0,0.9', false);
|
||||||
|
|
|
@ -1248,15 +1248,30 @@ Phaser.BitmapData.prototype = {
|
||||||
*
|
*
|
||||||
* @method Phaser.BitmapData#textureLine
|
* @method Phaser.BitmapData#textureLine
|
||||||
* @param {Phaser.Line} line - A Phaser.Line object that will be used to plot the start and end of the line.
|
* @param {Phaser.Line} line - A Phaser.Line object that will be used to plot the start and end of the line.
|
||||||
* @param {string} key - The key of an image in the Phaser.Cache to use as the texture for this line.
|
* @param {string|HTMLImage} image - The key of an image in the Phaser.Cache to use as the texture for this line, or an actual Image.
|
||||||
* @param {string} [repeat='repeat-x'] - The pattern repeat mode to use when drawing the line. Either `repeat`, `repeat-x` or `no-repeat`.
|
* @param {string} [repeat='repeat-x'] - The pattern repeat mode to use when drawing the line. Either `repeat`, `repeat-x` or `no-repeat`.
|
||||||
* @return {Phaser.BitmapData} This BitmapData object for method chaining.
|
* @return {Phaser.BitmapData} This BitmapData object for method chaining.
|
||||||
*/
|
*/
|
||||||
textureLine: function (line, key, repeat) {
|
textureLine: function (line, image, repeat) {
|
||||||
|
|
||||||
if (typeof repeat === 'undefined') { repeat = 'repeat-x'; }
|
if (typeof repeat === 'undefined') { repeat = 'repeat-x'; }
|
||||||
|
|
||||||
var image = this.game.cache.getImage(key);
|
if (typeof image === 'string')
|
||||||
|
{
|
||||||
|
image = this.game.cache.getImage(image);
|
||||||
|
|
||||||
|
if (!image)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var width = line.length;
|
||||||
|
|
||||||
|
if (repeat === 'no-repeat' && width > image.width)
|
||||||
|
{
|
||||||
|
width = image.width;
|
||||||
|
}
|
||||||
|
|
||||||
this.context.fillStyle = this.context.createPattern(image, repeat);
|
this.context.fillStyle = this.context.createPattern(image, repeat);
|
||||||
|
|
||||||
|
@ -1267,7 +1282,7 @@ Phaser.BitmapData.prototype = {
|
||||||
this.context.save();
|
this.context.save();
|
||||||
this.context.translate(this._pos.x, this._pos.y);
|
this.context.translate(this._pos.x, this._pos.y);
|
||||||
this.context.rotate(line.angle);
|
this.context.rotate(line.angle);
|
||||||
this.context.fillRect(0, 0, line.length, image.height);
|
this.context.fillRect(0, 0, width, image.height);
|
||||||
this.context.restore();
|
this.context.restore();
|
||||||
|
|
||||||
this.dirty = true;
|
this.dirty = true;
|
||||||
|
|
Loading…
Reference in a new issue