mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-03 09:32:38 +08:00
fix cannot set property color of graphics which has only a getter (#5972)
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user