Skip to content

Commit

Permalink
修复bug
Browse files Browse the repository at this point in the history
  • Loading branch information
himuil committed May 4, 2014
1 parent 586c541 commit f1d9df2
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 23 deletions.
22 changes: 0 additions & 22 deletions examples/TestText.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,8 @@ function createExample() {


var colorLabel = new ns_egret.TextField();
<<<<<<< HEAD
// colorLabel.setContentSize(0, 0);
colorLabel.textColor = "#ff0000";
=======
// colorLabel.width = colorLabel.height = 0;
colorLabel.textColor = 0xff0000;
>>>>>>> refactor
colorLabel.textAlign = "left";
colorLabel.text = "这是一段居左的文字\n可以支持多行";
container.addChild(colorLabel);
Expand All @@ -39,14 +34,9 @@ function createExample() {
var colorLabel = new ns_egret.TextField();
colorLabel.x = 0;
colorLabel.y = 100;
<<<<<<< HEAD
colorLabel.setContentSize(120, 0);
colorLabel.textColor = "#ff0000";
=======
colorLabel.width = 120;
colorLabel.height = 0;
colorLabel.textColor = 0xff0000;
>>>>>>> refactor
colorLabel.textAlign = "center";
colorLabel.text = "这是一段居中的文字,宽度设置120,字号设置30px,所以正好显示4个";
container.addChild(colorLabel);
Expand All @@ -55,16 +45,10 @@ function createExample() {
var colorLabel = new ns_egret.TextField();
colorLabel.x = 400;
colorLabel.y = 250;
<<<<<<< HEAD
colorLabel.setContentSize(160, 0);
colorLabel.relativeAnchorPointX = 1;
colorLabel.textColor = "#FFFFFF";
=======
colorLabel.width = 160;
colorLabel.height = 0;
colorLabel.relativeAnchorPointX = 1;
colorLabel.textColor = 0xFFFFFF;
>>>>>>> refactor
colorLabel.textAlign = "right";
colorLabel.text = "这个文字居右对齐";
container.addChild(colorLabel);
Expand All @@ -74,15 +58,9 @@ function createExample() {
var strokeLabel = new ns_egret.TextField();
strokeLabel.x = 400;
strokeLabel.y = 20;
<<<<<<< HEAD
strokeLabel.textColor = "#FFFFFF";
strokeLabel.text = "描边";
strokeLabel.strokeColor = "#FF0000";
=======
strokeLabel.textColor = 0xFFFFFF;
strokeLabel.text = "描边";
strokeLabel.strokeColor = 0xFF0000;
>>>>>>> refactor
strokeLabel.stroke = 2;
container.addChild(strokeLabel);

Expand Down
2 changes: 1 addition & 1 deletion src/egret/context/renderer/HTML5CanvasRenderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ module ns_egret {
renderContext.strokeStyle = strokeColor;
if (outline) {
renderContext.lineWidth = outline * 2;
renderContext.strokeText(text, x, y, maxWidth || 0xFFFF);
renderContext.strokeText(text, x + this._transformTx, y + this._transformTy, maxWidth || 0xFFFF);
}
renderContext.fillText(text, x + this._transformTx, y + this._transformTy, maxWidth || 0xFFFF);
super.drawText(textField,text, x, y, maxWidth);
Expand Down

0 comments on commit f1d9df2

Please sign in to comment.