emeraldengine 2.0.1 → 2.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -16,8 +16,6 @@ class EventManager {
16
16
  this.keyDownListeners = new Map();
17
17
  this.keyUpListeners = new Map();
18
18
  this.clickListeners = new Map();
19
- this.canvasWidth = canvas.width;
20
- this.canvasHeight = canvas.height;
21
19
  this.hoverListeners = new Map();
22
20
  this.lastHoveredObject = null;
23
21
  this.lastHoveredInstance = null;
@@ -187,9 +185,9 @@ class EventManager {
187
185
 
188
186
  // Convert to world coordinates
189
187
  const worldX =
190
- canvasX - this.canvasWidth / 2 - this.camera.transform.position.x;
188
+ canvasX - this.canvas.width / 2 - this.camera.transform.position.x;
191
189
  const worldY =
192
- this.canvasHeight / 2 - canvasY - this.camera.transform.position.y;
190
+ this.canvas.height / 2 - canvasY - this.camera.transform.position.y;
193
191
 
194
192
  this.scene.objects.forEach((sceneObject) => {
195
193
  if (!sceneObject.isActive) return; // Skip inactive objects
@@ -326,9 +324,9 @@ class EventManager {
326
324
 
327
325
  // Convert to world coordinates
328
326
  const worldX =
329
- canvasX - this.canvasWidth / 2 - this.camera.transform.position.x;
327
+ canvasX - this.canvas.width / 2 - this.camera.transform.position.x;
330
328
  const worldY =
331
- this.canvasHeight / 2 - canvasY - this.camera.transform.position.y;
329
+ this.canvas.height / 2 - canvasY - this.camera.transform.position.y;
332
330
  this.mousePosition.x = worldX;
333
331
  this.mousePosition.y = worldY;
334
332
  let hoveredObject = null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "emeraldengine",
3
- "version": "2.0.1",
3
+ "version": "2.0.2",
4
4
  "description": "2D graphics library for Web",
5
5
  "type": "module",
6
6
  "main": "index.js",