1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-12-18 23:10:26 +00:00

vr:: fixed VR UI pointing if the rectangle is changed

This commit is contained in:
Zeno Rogue 2021-02-07 18:35:32 +01:00
parent ecb01118c1
commit 8ee918c7ee

4
vr.cpp
View File

@ -393,8 +393,8 @@ void track_poses() {
hyperpoint px = pxo; hyperpoint px = pxo;
px[0] /= ui_size * ui_size_unit; px[0] /= ui_size * ui_size_unit;
px[1] /= -ui_size * ui_size_unit; px[1] /= -ui_size * ui_size_unit;
px[0] += current_display->xsize/2; px[0] += (ui_xmin+ui_xmax) / 2;
px[1] += current_display->ysize/2; px[1] += (ui_ymin+ui_ymax) / 2;
targeting_menu = px[0] >= 0 && px[1] >= 0 && px[1] <= vid.xres && px[1] <= vid.xres; targeting_menu = px[0] >= 0 && px[1] >= 0 && px[1] <= vid.xres && px[1] <= vid.xres;
if(targeting_menu) { if(targeting_menu) {
mousex = px[0]; mousex = px[0];