mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-01 15:52:40 +08:00
fix editbox setFontColor for Editor (#3083)
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user