-
-
Notifications
You must be signed in to change notification settings - Fork 6
#242 stageのaddChildの仕様を変更、webgpuのe2eテストのpngを更新 #249
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 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -183,9 +183,12 @@ export class Stage extends DisplayObjectContainer | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| $stageAssignedMap.add(display_object.instanceId); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // fixed logic | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| $rootMap.set(this, display_object); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| super.addChild(display_object); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // fixed logic for root map | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| $rootMap.delete(this); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| $rootMap.set(display_object, display_object); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
184
to
193
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| $stageAssignedMap.add(display_object.instanceId); | |
| // fixed logic | |
| $rootMap.set(this, display_object); | |
| super.addChild(display_object); | |
| // fixed logic for root map | |
| $rootMap.delete(this); | |
| $rootMap.set(display_object, display_object); | |
| const instanceId = display_object.instanceId; | |
| $stageAssignedMap.add(instanceId); | |
| // fixed logic | |
| $rootMap.set(this, display_object); | |
| let added = false; | |
| try { | |
| super.addChild(display_object); | |
| added = true; | |
| } finally { | |
| // always remove temporary root mapping | |
| $rootMap.delete(this); | |
| // rollback stage assignment if addChild fails | |
| if (!added) { | |
| $stageAssignedMap.delete(instanceId); | |
| } | |
| } | |
| if (added) { | |
| // fixed logic for root map | |
| $rootMap.set(display_object, display_object); | |
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comments
// fixed logic/// fixed logic for root mapdon’t explain the invariant being maintained here. Please replace them with a short explanation of why Stage is temporarily inserted into$rootMapand why it must be removed immediately aftersuper.addChild().