From 479bcb1d179fba8559d681ac318cf1a34e367c43 Mon Sep 17 00:00:00 2001 From: amyspark-ng <92493175+amyspark-ng@users.noreply.github.com> Date: Sun, 5 Jul 2026 19:52:41 -0500 Subject: [PATCH 1/3] fix: area scale didn't set --- src/ecs/components/physics/area.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ecs/components/physics/area.ts b/src/ecs/components/physics/area.ts index c8abdbc1a..eacb62460 100644 --- a/src/ecs/components/physics/area.ts +++ b/src/ecs/components/physics/area.ts @@ -562,7 +562,7 @@ export function area( return _shape; }, set scale(value: Vec2) { - _scale = this.scale; + _scale = value; _localAreaVersion = nextLocalAreaVersion(); }, get scale(): Vec2 { From eef3effd93ac6c97e8baccdfa40ba669237b95b0 Mon Sep 17 00:00:00 2001 From: amyspark-ng <92493175+amyspark-ng@users.noreply.github.com> Date: Sun, 5 Jul 2026 19:55:24 -0500 Subject: [PATCH 2/3] changelogged --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 799611287..239b1e20f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -59,6 +59,7 @@ So your change should look like: ### Fixed +- Fixed `AreaComp.area.scale` not setting properly (#1120) - @amyspark-ng - Fixed `TimerController.timeLeft` returning elapsed time instead of remaining time (#1082) - @nojaf - Fixed mouse coordinates not being calculated properly when canvas is resized From 204a8caa6c90b1c19995ea7cedf9acd579d2f1af Mon Sep 17 00:00:00 2001 From: imaginarny Date: Tue, 7 Jul 2026 14:17:11 +0200 Subject: [PATCH 3/3] fix: track vec2 prop changes using proxy --- CHANGELOG.md | 4 +++- src/ecs/components/physics/area.ts | 24 ++++++++++++++++++++---- 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 239b1e20f..f28022660 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -59,13 +59,15 @@ So your change should look like: ### Fixed -- Fixed `AreaComp.area.scale` not setting properly (#1120) - @amyspark-ng - Fixed `TimerController.timeLeft` returning elapsed time instead of remaining time (#1082) - @nojaf - Fixed mouse coordinates not being calculated properly when canvas is resized by CSS and wasn't rendered at its natural size (#1096) - @Stanko - Modified `pos`, `skew` and `scale` components to make operations like `obj.pos.x += 1` work again (#1109) - @ErikGXDev +- Fixed `AreaComp.area.scale` not being set properly and restored support for + `Vec2` property mutations on `scale` and `offset` (#1121) - @amyspark-ng, + @imaginarny - Fixed `isKeyDown` and `isButtonDown` getting stuck on game loosing focus (#1101) - @Stanko diff --git a/src/ecs/components/physics/area.ts b/src/ecs/components/physics/area.ts index eacb62460..56340bc19 100644 --- a/src/ecs/components/physics/area.ts +++ b/src/ecs/components/physics/area.ts @@ -449,7 +449,9 @@ export function area( let _shape: Shape | null = opt.shape ?? null; let _scale: Vec2 = opt.scale ? vec2(opt.scale) : vec2(1); + let _scaleProxy: Vec2 | null = null; let _offset: Vec2 = opt.offset ?? vec2(0); + let _offsetProxy: Vec2 | null = null; let _cursor: Cursor | null = opt.cursor ?? null; let _localAreaVersion = -1; // Track local changes in area properties @@ -562,18 +564,32 @@ export function area( return _shape; }, set scale(value: Vec2) { - _scale = value; + _scale.x = value.x; + _scale.y = value.y; _localAreaVersion = nextLocalAreaVersion(); }, get scale(): Vec2 { - return _scale; + return (_scaleProxy ??= new Proxy(_scale, { + set(target, prop, value) { + Reflect.set(target, prop, value); + _localAreaVersion = nextLocalAreaVersion(); + return true; + }, + })); }, set offset(value: Vec2) { - _offset = value; + _offset.x = value.x; + _offset.y = value.y; _localAreaVersion = nextLocalAreaVersion(); }, get offset() { - return _offset; + return (_offsetProxy ??= new Proxy(_offset, { + set(target, prop, value) { + Reflect.set(target, prop, value); + _localAreaVersion = nextLocalAreaVersion(); + return true; + }, + })); }, set cursor(value: Cursor | null) { _cursor = value;