Skip to content

Commit

Permalink
Fix setMouse with letter-boxing
Browse files Browse the repository at this point in the history
  • Loading branch information
jhasse committed Oct 11, 2023
1 parent 7ab9c79 commit a616b37
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -347,8 +347,8 @@ bool mousePressed(mouse::Button button) {

void setMouse(const jngl::Vec2 position) {
pWindow->SetMouse(
static_cast<int>(std::lround((position.x + getScreenWidth() / 2) * getScaleFactor())),
static_cast<int>(std::lround((position.y + getScreenHeight() / 2) * getScaleFactor())));
static_cast<int>(std::lround(position.x * getScaleFactor() + pWindow->getWidth() / 2.)),
static_cast<int>(std::lround(position.y * getScaleFactor() + pWindow->getHeight() / 2.)));
}

void setRelativeMouseMode(const bool relative) {
Expand Down

0 comments on commit a616b37

Please sign in to comment.