Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
33 changes: 17 additions & 16 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ jobs:
permissions:
contents: read
pull-requests: write
id-token: write
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
Expand All @@ -24,36 +25,36 @@ jobs:
- run: npm install -g npm@latest
- run: npm install
- run: npm run publish:dist
- run: npm publish
- run: npm publish --access public
working-directory: ./dist/src
- run: npm publish
- run: npm publish --access public
working-directory: ./dist/packages/cache
- run: npm publish
- run: npm publish --access public
working-directory: ./dist/packages/core
- run: npm publish
- run: npm publish --access public
working-directory: ./dist/packages/display
- run: npm publish
- run: npm publish --access public
working-directory: ./dist/packages/events
- run: npm publish
- run: npm publish --access public
working-directory: ./dist/packages/filters
- run: npm publish
- run: npm publish --access public
working-directory: ./dist/packages/geom
- run: npm publish
- run: npm publish --access public
working-directory: ./dist/packages/media
- run: npm publish
- run: npm publish --access public
working-directory: ./dist/packages/net
- run: npm publish
- run: npm publish --access public
working-directory: ./dist/packages/render-queue
- run: npm publish
- run: npm publish --access public
working-directory: ./dist/packages/renderer
- run: npm publish
- run: npm publish --access public
working-directory: ./dist/packages/text
- run: npm publish
- run: npm publish --access public
working-directory: ./dist/packages/texture-packer
- run: npm publish
- run: npm publish --access public
working-directory: ./dist/packages/ui
- run: npm publish
- run: npm publish --access public
working-directory: ./dist/packages/webgl
- run: npm publish
- run: npm publish --access public
working-directory: ./dist/packages/webgpu
- run: npm run clean
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions packages/display/src/Stage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Comment on lines +186 to 190
Copy link

Copilot AI Feb 11, 2026

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 map don’t explain the invariant being maintained here. Please replace them with a short explanation of why Stage is temporarily inserted into $rootMap and why it must be removed immediately after super.addChild().

Suggested change
// fixed logic
$rootMap.set(this, display_object);
super.addChild(display_object);
// fixed logic for root map
// Temporarily register Stage as the current root so that any logic in super.addChild()
// that consults $rootMap can treat this added subtree as belonging to this Stage.
$rootMap.set(this, display_object);
super.addChild(display_object);
// Restore the $rootMap invariant: only root DisplayObjects (Stage children) are kept as keys,
// not Stage itself, so remove the temporary Stage entry and register the new root child instead.

Copilot uses AI. Check for mistakes.
$rootMap.delete(this);
$rootMap.set(display_object, display_object);

Comment on lines 184 to 193
Copy link

Copilot AI Feb 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$rootMap.set(this, display_object) is used as a temporary hack so super.addChild() will treat display_object as the Stage root. However super.addChild() dispatches events (e.g. ADDED) that can throw, which would skip the cleanup and leave this mapped in $rootMap (and also leave display_object.instanceId in $stageAssignedMap). Wrap the super.addChild() call in try/finally to guarantee $rootMap.delete(this) (and rollback stage assignment if the add fails).

Suggested change
$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);
}

Copilot uses AI. Check for mistakes.
return display_object;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ struct VertexOutput {

@fragment
fn main(input: VertexOutput) -> @location(0) vec4<f32> {
var src = textureSampleLevel(textureData, textureSampler, input.texCoord, 0);
var src = textureSample(textureData, textureSampler, input.texCoord);
src = vec4<f32>(src.rgb / max(0.0001, src.a), src.a);
src = clamp(src * input.mulColor + input.addColor, vec4<f32>(0.0), vec4<f32>(1.0));
src = vec4<f32>(src.rgb * src.a, src.a);
Expand Down
Loading