-
Notifications
You must be signed in to change notification settings - Fork 199
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add fragment to support batch operations
- Loading branch information
Showing
11 changed files
with
235 additions
and
156 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { Shape } from '../types'; | ||
import { DisplayObject } from './DisplayObject'; | ||
|
||
/** | ||
* 节点片段,用于包裹多个节点并批量操作 | ||
* | ||
* 向 Fragment 或者根节点为 Fragment 的节点添加子节点时,不会触发渲染和事件。 | ||
* | ||
* 当 Fragment 被挂载到 Canvas 中的节点时,其子节点会一次性被渲染,并触发合并事件。 | ||
* | ||
* @see https://developer.mozilla.org/en-US/docs/Web/API/DocumentFragment | ||
*/ | ||
export class Fragment extends DisplayObject { | ||
constructor() { | ||
super({ type: Shape.FRAGMENT }); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.