fix editbox setFontColor for Editor (#3083)

This commit is contained in:
PP
2018-08-14 15:48:41 +08:00
committed by pandamicro
parent 6be4597e5c
commit 482fe0a040
2 changed files with 9 additions and 2 deletions
@@ -170,6 +170,9 @@ let EditBox = cc.Class({
if (this._textLabel) {
this._textLabel.fontSize = this.fontSize;
}
if (this._impl) {
this._impl.setFontSize(this.fontSize);
}
}
},
@@ -198,8 +201,12 @@ let EditBox = cc.Class({
default: cc.Color.WHITE,
notify () {
if (this._textLabel) {
this._textLabel.node.opacity = this.fontColor.a;
this._textLabel.node.color = this.fontColor;
}
if (this._impl) {
this._impl.setFontColor(this.fontColor);
}
}
},
@@ -201,7 +201,7 @@ let EditBoxImpl = cc.Class({
setFontColor (color) {
this._textColor = color;
this._edTxt.style.color = color.toHEX();
this._edTxt.style.color = color.toCSS('rgba');
},
setSize (width, height) {
@@ -479,7 +479,7 @@ function registerInputEventListener (tmpEdTxt, editBoxImpl, isTextarea) {
cbs.focus = function () {
this.style.fontSize = editBoxImpl._edFontSize + 'px';
this.style.color = editBoxImpl._textColor.toCSS('#rrggbbaa');
this.style.color = editBoxImpl._textColor.toCSS('rgba');
// When stayOnTop, input will swallow touch event
if (editBoxImpl._alwaysOnTop) {
editBoxImpl._editing = true;