Skip to content

Commit

Permalink
simplify mouse transform
Browse files Browse the repository at this point in the history
  • Loading branch information
openshwprojects committed Sep 19, 2024
1 parent 78119a2 commit afa7b8a
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/sim/Simulator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,7 @@ Coord GetMousePosWorld() {
// BUGFIX FOR MENUBAR OFFSET
//my += WINDOWS_MOUSE_MENUBAR_OFFSET;
r.set(mx, my);
float ndcX = (r.getX() / WinWidth);
float ndcY = (r.getY() / WinHeight);
r.setX(camera.getX() + (ndcX * WinWidth / (zoomFactor)));
r.setY(camera.getY() + (ndcY * WinHeight / (zoomFactor)));
r = camera + r / zoomFactor;
return r;
}
void CSimulator::drawWindow() {
Expand Down

0 comments on commit afa7b8a

Please sign in to comment.