mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2024-12-22 17:49:43 +01:00
Fix scaling editor mouse coords properly in stretch mode
Now your cursor will properly align with the editor's cursor if you're in stretch mode. Closes #27.
This commit is contained in:
parent
165882182b
commit
3e9bd3aaac
1 changed files with 7 additions and 0 deletions
|
@ -3642,6 +3642,13 @@ void editorinput( KeyPoll& key, Graphics& dwgfx, Game& game, mapclass& map, enti
|
|||
game.my = (float) key.my;
|
||||
ed.tilex=(game.mx - (game.mx%8))/8;
|
||||
ed.tiley=(game.my - (game.my%8))/8;
|
||||
if (game.stretchMode == 1) {
|
||||
// In this mode specifically, we have to fix the mouse coordinates
|
||||
int winwidth, winheight;
|
||||
dwgfx.screenbuffer->GetWindowSize(&winwidth, &winheight);
|
||||
ed.tilex = ed.tilex * 320 / winwidth;
|
||||
ed.tiley = ed.tiley * 240 / winheight;
|
||||
}
|
||||
|
||||
game.press_left = false;
|
||||
game.press_right = false;
|
||||
|
|
Loading…
Reference in a new issue