Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions packages/g-lite/src/display-objects/DisplayObject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,25 @@ export class DisplayObject<
}
}

/**
* batch update attributes without attributeChangedCallback, for performance
* use with caution
* @param attributes
* @param parseOptions
*/
setAttributes(
attributes: Partial<StyleProps>,
parseOptions: Partial<PropertyParseOptions> = {},
) {
runtime.styleValueRegistry.processProperties(
this as unknown as DisplayObject,
attributes,
parseOptions,
);
// redraw at next frame
this.dirty();
}

/**
* called when attributes get changed or initialized
*/
Expand Down
Loading