-
Notifications
You must be signed in to change notification settings - Fork 0
fix: add key and args properties to State class #161
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -90,11 +90,11 @@ export default class SelectionState extends State { | |
|
|
||
| /** | ||
| * Enters the selection state with a given context and configuration. | ||
| * @param {object} context - The application context, containing the viewport. | ||
| * @param {SelectionStateConfig} config - Configuration for the selection behavior. | ||
| * @param {...*} args - Additional arguments passed to the state. | ||
| */ | ||
| enter(context, config = {}) { | ||
| super.enter(context); | ||
| enter(...args) { | ||
| super.enter(...args); | ||
| const [_, config] = args; | ||
| this.config = deepMerge(defaultConfig, config); | ||
| this.viewport = this.context.viewport; | ||
| this.viewport.addChild(this._selectionBox); | ||
|
|
@@ -103,7 +103,9 @@ export default class SelectionState extends State { | |
| exit() { | ||
| super.exit(); | ||
| this.#clear({ state: true, selectionBox: true, gesture: true }); | ||
| this._selectionBox?.destroy(true); | ||
| if (this._selectionBox.parent) { | ||
| this._selectionBox.parent.removeChild(this._selectionBox); | ||
| } | ||
|
Comment on lines
+106
to
+108
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Changing A robust solution would involve a separate this._selectionBox?.destroy(); |
||
| } | ||
|
|
||
| pause() { | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.