Skip to content

Commit

Permalink
Cast mouse coords to int AFTER double division
Browse files Browse the repository at this point in the history
  • Loading branch information
NQNStudios committed May 27, 2024
1 parent de8f7bd commit 6efb9ec
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/dialogxml/dialogs/dialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -688,7 +688,7 @@ void cDialog::handle_one_event(const sf::Event& currentEvent) {
if(kb.isMetaPressed()) key.mod += mod_ctrl;
if(kb.isAltPressed()) key.mod += mod_alt;
if(kb.isShiftPressed()) key.mod += mod_shift;
where = {currentEvent.mouseButton.x / ui_scale, currentEvent.mouseButton.y / ui_scale};
where = {(int)(currentEvent.mouseButton.x / ui_scale), (int)(currentEvent.mouseButton.y / ui_scale)};
process_click(where, key.mod);
break;
default: // To silence warning of unhandled enum values
Expand Down

0 comments on commit 6efb9ec

Please sign in to comment.