mirror of
https://github.com/cocos/cocos4.git
synced 2026-11-21 16:12:40 +08:00
fixed the problem of graphics component scene error when the script is changed (#6922)
This commit is contained in:
@@ -259,8 +259,6 @@ export class GraphicsComponent extends UIRenderComponent {
|
||||
public onEnable () {
|
||||
super.onEnable();
|
||||
|
||||
this._attachToScene();
|
||||
|
||||
this._activateMaterial();
|
||||
}
|
||||
|
||||
@@ -536,8 +534,8 @@ export class GraphicsComponent extends UIRenderComponent {
|
||||
* 根据当前的画线样式,绘制当前或已经存在的路径。
|
||||
*/
|
||||
public stroke () {
|
||||
this._attachToScene();
|
||||
(this._assembler as IAssembler).stroke!(this);
|
||||
this._attachToScene();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -548,8 +546,8 @@ export class GraphicsComponent extends UIRenderComponent {
|
||||
* 根据当前的画线样式,填充当前或已经存在的路径。
|
||||
*/
|
||||
public fill () {
|
||||
this._attachToScene();
|
||||
(this._assembler as IAssembler).fill!(this);
|
||||
this._attachToScene();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user