mirror of
https://github.com/DrBeef/ioq3quest.git
synced 2024-11-26 05:52:03 +00:00
Fix q3_ui cursor going off screen in widescreen
This commit is contained in:
parent
e77153766a
commit
d9c2e91919
1 changed files with 8 additions and 4 deletions
|
@ -872,17 +872,21 @@ UI_MouseEvent
|
|||
void UI_MouseEvent( int dx, int dy )
|
||||
{
|
||||
int i;
|
||||
int bias;
|
||||
menucommon_s* m;
|
||||
|
||||
if (!uis.activemenu)
|
||||
return;
|
||||
|
||||
// convert X bias to 640 coords
|
||||
bias = uis.bias / uis.xscale;
|
||||
|
||||
// update mouse screen position
|
||||
uis.cursorx += dx;
|
||||
if (uis.cursorx < -uis.bias)
|
||||
uis.cursorx = -uis.bias;
|
||||
else if (uis.cursorx > SCREEN_WIDTH+uis.bias)
|
||||
uis.cursorx = SCREEN_WIDTH+uis.bias;
|
||||
if (uis.cursorx < -bias)
|
||||
uis.cursorx = -bias;
|
||||
else if (uis.cursorx > SCREEN_WIDTH+bias)
|
||||
uis.cursorx = SCREEN_WIDTH+bias;
|
||||
|
||||
uis.cursory += dy;
|
||||
if (uis.cursory < 0)
|
||||
|
|
Loading…
Reference in a new issue