Skip to content

Commit 808e53f

Browse files
committed
Fixed order of shadow fills.
1 parent 741b93d commit 808e53f

3 files changed

Lines changed: 22 additions & 11 deletions

File tree

v3/src/checksum.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
var CHECKSUM = {
2-
build: '0f082750-0d8a-11e7-b206-7db386f7c304'
2+
build: 'd02c5bc0-0d8c-11e7-bd94-817b24a2ca5b'
33
};
44
module.exports = CHECKSUM;

v3/src/gameobjects/text/TextStyle.js

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -70,24 +70,24 @@ var TextStyle = new Class({
7070
context.lineJoin = 'round';
7171
},
7272

73-
syncShadow: function (context, reset)
73+
syncShadow: function (context, enabled)
7474
{
7575
var style = this;
7676

77-
if (reset)
78-
{
79-
context.shadowOffsetX = 0;
80-
context.shadowOffsetY = 0;
81-
context.shadowColor = 0;
82-
context.shadowBlur = 0;
83-
}
84-
else
77+
if (enabled)
8578
{
8679
context.shadowOffsetX = style.shadowOffsetX;
8780
context.shadowOffsetY = style.shadowOffsetY;
8881
context.shadowColor = style.shadowColor;
8982
context.shadowBlur = style.shadowBlur;
9083
}
84+
else
85+
{
86+
context.shadowOffsetX = 0;
87+
context.shadowOffsetY = 0;
88+
context.shadowColor = 0;
89+
context.shadowBlur = 0;
90+
}
9191
},
9292

9393
update: function (recalculateMetrics)
@@ -169,6 +169,7 @@ var TextStyle = new Class({
169169

170170
setShadow: function (x, y, color, blur, shadowStroke, shadowFill)
171171
{
172+
if (x === undefined) { x = 0; }
172173
if (y === undefined) { y = 0; }
173174
if (color === undefined) { color = '#000'; }
174175
if (blur === undefined) { blur = 0; }

v3/src/gameobjects/text/static/Text.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ var Text = new Class({
5656
*/
5757
this.splitRegExp = /(?:\r\n|\r|\n)/;
5858

59-
this.text = text;
59+
this.text = (Array.isArray(text)) ? text.join('\n') : text;
6060

6161
this.resolution = 1;
6262

@@ -73,9 +73,15 @@ var Text = new Class({
7373

7474
setText: function (value)
7575
{
76+
if (Array.isArray(value))
77+
{
78+
value = value.join('\n');
79+
}
80+
7681
if (value !== this.text)
7782
{
7883
this.text = value;
84+
7985
this.updateText();
8086
}
8187

@@ -191,6 +197,10 @@ var Text = new Class({
191197
canvas.width = w;
192198
canvas.height = h;
193199
}
200+
else
201+
{
202+
context.clearRect(0, 0, w, h);
203+
}
194204

195205
if (style.backgroundColor)
196206
{

0 commit comments

Comments
 (0)