Fixed issue with mouse zoom

This commit is contained in:
neauoire 2021-08-01 21:51:43 -07:00
parent a58ffb9828
commit de3591c07e
2 changed files with 4 additions and 4 deletions

View File

@ -54,9 +54,9 @@ then
fi
echo "Assembling.."
./bin/uxnasm projects/examples/devices/screen.tal bin/screen.rom
./bin/uxnasm projects/examples/demos/theme.tal bin/theme.rom
echo "Running.."
./bin/uxnemu bin/screen.rom
./bin/uxnemu bin/theme.rom
echo "Done."

View File

@ -213,8 +213,8 @@ static void
domouse(SDL_Event *event)
{
Uint8 flag = 0x00;
Uint16 x = clamp(event->motion.x - PAD, 0, ppu.width - 1);
Uint16 y = clamp(event->motion.y - PAD, 0, ppu.height - 1);
Uint16 x = clamp(event->motion.x / zoom - PAD, 0, ppu.width - 1);
Uint16 y = clamp(event->motion.y / zoom - PAD, 0, ppu.height - 1);
mempoke16(devmouse->dat, 0x2, x);
mempoke16(devmouse->dat, 0x4, y);
switch(event->button.button) {