1
0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-06-18 10:38:31 +02: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;