fix cannot set property color of graphics which has only a getter (#5972)

This commit is contained in:
JoneLau
2019-12-26 18:12:22 +08:00
committed by pandamicro
parent 077cc5e5bc
commit d78c914b71
2 changed files with 15 additions and 1 deletions
+5 -1
View File
@@ -149,8 +149,12 @@ const temp_uvs: IUV[] = [{ u: 0, v: 0 }, { u: 0, v: 0 }, { u: 0, v: 0 }, { u: 0,
*
* // Second way to use a SpriteFrame
* const self = this;
* const url = "assets/PurpleMonster/icon";
* const url = "test_assets/PurpleMonster";
* cc.loader.loadRes(url, (err, imageAsset) => {
* if(err){
* return;
* }
*
* const node = new Node("New Sprite");
* const sprite = node.addComponent(SpriteComponent);
* const spriteFrame = new SpriteFrame();
+10
View File
@@ -180,6 +180,16 @@ export class GraphicsComponent extends UIRenderComponent {
return this._color;
}
set color (value) {
if (this._color === value) {
return;
}
this._color.set(value);
this._updateColor();
this.markForUpdateRenderData();
}
public static LineJoin = LineJoin;
public static LineCap = LineCap;
public impl: Impl | null = null;