Skip to content

Commit f1d9df2

Browse files
committed
修复bug
1 parent 586c541 commit f1d9df2

File tree

2 files changed

+1
-23
lines changed

2 files changed

+1
-23
lines changed

examples/TestText.js

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,8 @@ function createExample() {
2424

2525

2626
var colorLabel = new ns_egret.TextField();
27-
<<<<<<< HEAD
28-
// colorLabel.setContentSize(0, 0);
29-
colorLabel.textColor = "#ff0000";
30-
=======
3127
// colorLabel.width = colorLabel.height = 0;
3228
colorLabel.textColor = 0xff0000;
33-
>>>>>>> refactor
3429
colorLabel.textAlign = "left";
3530
colorLabel.text = "这是一段居左的文字\n可以支持多行";
3631
container.addChild(colorLabel);
@@ -39,14 +34,9 @@ function createExample() {
3934
var colorLabel = new ns_egret.TextField();
4035
colorLabel.x = 0;
4136
colorLabel.y = 100;
42-
<<<<<<< HEAD
43-
colorLabel.setContentSize(120, 0);
44-
colorLabel.textColor = "#ff0000";
45-
=======
4637
colorLabel.width = 120;
4738
colorLabel.height = 0;
4839
colorLabel.textColor = 0xff0000;
49-
>>>>>>> refactor
5040
colorLabel.textAlign = "center";
5141
colorLabel.text = "这是一段居中的文字,宽度设置120,字号设置30px,所以正好显示4个";
5242
container.addChild(colorLabel);
@@ -55,16 +45,10 @@ function createExample() {
5545
var colorLabel = new ns_egret.TextField();
5646
colorLabel.x = 400;
5747
colorLabel.y = 250;
58-
<<<<<<< HEAD
59-
colorLabel.setContentSize(160, 0);
60-
colorLabel.relativeAnchorPointX = 1;
61-
colorLabel.textColor = "#FFFFFF";
62-
=======
6348
colorLabel.width = 160;
6449
colorLabel.height = 0;
6550
colorLabel.relativeAnchorPointX = 1;
6651
colorLabel.textColor = 0xFFFFFF;
67-
>>>>>>> refactor
6852
colorLabel.textAlign = "right";
6953
colorLabel.text = "这个文字居右对齐";
7054
container.addChild(colorLabel);
@@ -74,15 +58,9 @@ function createExample() {
7458
var strokeLabel = new ns_egret.TextField();
7559
strokeLabel.x = 400;
7660
strokeLabel.y = 20;
77-
<<<<<<< HEAD
78-
strokeLabel.textColor = "#FFFFFF";
79-
strokeLabel.text = "描边";
80-
strokeLabel.strokeColor = "#FF0000";
81-
=======
8261
strokeLabel.textColor = 0xFFFFFF;
8362
strokeLabel.text = "描边";
8463
strokeLabel.strokeColor = 0xFF0000;
85-
>>>>>>> refactor
8664
strokeLabel.stroke = 2;
8765
container.addChild(strokeLabel);
8866

src/egret/context/renderer/HTML5CanvasRenderer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ module ns_egret {
160160
renderContext.strokeStyle = strokeColor;
161161
if (outline) {
162162
renderContext.lineWidth = outline * 2;
163-
renderContext.strokeText(text, x, y, maxWidth || 0xFFFF);
163+
renderContext.strokeText(text, x + this._transformTx, y + this._transformTy, maxWidth || 0xFFFF);
164164
}
165165
renderContext.fillText(text, x + this._transformTx, y + this._transformTy, maxWidth || 0xFFFF);
166166
super.drawText(textField,text, x, y, maxWidth);

0 commit comments

Comments
 (0)