Skip to content

Commit

Permalink
fix: issue with *AndFill suffixed [[DisplayModes]]s where content are…
Browse files Browse the repository at this point in the history
…a offset was not accounted for in world space
  • Loading branch information
eonarheim committed Jan 29, 2024
1 parent a9e8132 commit 79b5e68
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).

### Fixed

- Fixed issue with *AndFill suffixed [[DisplayModes]]s where content area offset was not accounted for in world space
- Fixed issue where `ex.Sound.getTotalPlaybackDuration()` would crash if not loaded, now logs friendly warning
- Fixed issue where an empty constructor on `new ex.Label()` would crash
- Fixed issue where pointer events did not work properly when using [[ScreenElement]]s
Expand Down
3 changes: 3 additions & 0 deletions src/engine/Screen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -632,6 +632,9 @@ export class Screen {
* @param point Screen coordinate to convert
*/
public screenToWorldCoordinates(point: Vector): Vector {
// offset by content area
point = point.add(vec(this.contentArea.left, this.contentArea.top));

// the only difference between screen & world is the camera transform
if (this._camera) {
return this._camera.inverse.multiply(point);
Expand Down

0 comments on commit 79b5e68

Please sign in to comment.