1
0
Fork 0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-12-22 09:39: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:
Info Teddy 2020-01-12 01:09:32 -08:00 committed by Ethan Lee
parent 165882182b
commit 3e9bd3aaac

View file

@ -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;