Skip to content
Open
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
18 changes: 18 additions & 0 deletions examples/demo/basic.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,5 +125,23 @@
initialize();
};

let panPos = undefined;

Check warning on line 128 in examples/demo/basic.js

View workflow job for this annotation

GitHub Actions / build

It's not necessary to initialize 'panPos' to undefined

app.canvas.addEventListener('mousemove', (e) => {

Check warning on line 130 in examples/demo/basic.js

View workflow job for this annotation

GitHub Actions / build

Opening curly brace appears on the same line as controlling statement
if (!panPos) return;

app.stage.position.x += e.pageX - panPos.x;
app.stage.position.y += e.pageY - panPos.y;
panPos = { x: e.pageX, y: e.pageY };
});

app.canvas.addEventListener('mousedown', (e) => {

Check warning on line 138 in examples/demo/basic.js

View workflow job for this annotation

GitHub Actions / build

Opening curly brace appears on the same line as controlling statement
panPos = { x: e.pageX, y: e.pageY };
});

app.canvas.addEventListener('mouseup', (e) => {

Check warning on line 142 in examples/demo/basic.js

View workflow job for this annotation

GitHub Actions / build

Opening curly brace appears on the same line as controlling statement
panPos = undefined;
});

runApp();
})();
3 changes: 1 addition & 2 deletions src/TilemapPipe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,7 @@ export class TilemapPipe implements RenderPipe<Tilemap>, InstructionPipe<Tilemap
let anim_frame = this.tileAnim;
const { u_anim_frame } = pipe_uniforms.uniforms;

u_global.uProjectionMatrix.copyTo(u_proj_trans).append(u_global.uWorldTransformMatrix)
.append(tilemap.worldTransform);
u_global.uProjectionMatrix.copyTo(u_proj_trans).append(tilemap.worldTransform);
if (tilemap.compositeParent)
{
anim_frame = (tilemap.parent as CompositeTilemap).tileAnim || anim_frame;
Expand Down