]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Center onlyowned panel if the original panel snaps to a whole screen side
authorterencehill <piuntn@gmail.com>
Mon, 9 Feb 2015 11:28:39 +0000 (12:28 +0100)
committerterencehill <piuntn@gmail.com>
Mon, 9 Feb 2015 11:28:39 +0000 (12:28 +0100)
qcsrc/client/hud.qc

index c799ad550d2f8acce515a2b1b54f8b791eb3efbb..f02139151a1a069d25e638212ad5f376ec15a0d0 100644 (file)
@@ -586,16 +586,24 @@ void HUD_Weapons(void)
 
                // center the resized panel, or snap it to the screen edge when close enough
                if(panel_pos.x > vid_conwidth * 0.001)
+               {
                        if(panel_pos.x + old_panel_size.x > vid_conwidth * 0.999)
                                panel_pos.x += old_panel_size.x - panel_size.x;
                        else
                                panel_pos.x += (old_panel_size.x - panel_size.x) / 2;
+               }
+               else if(old_panel_size.x > vid_conwidth * 0.999)
+                       panel_pos.x += (old_panel_size.x - panel_size.x) / 2;
 
                if(panel_pos.y > vid_conheight * 0.001)
+               {
                        if(panel_pos.y + old_panel_size.y > vid_conheight * 0.999)
                                panel_pos.y += old_panel_size.y - panel_size.y;
                        else
                                panel_pos.y += (old_panel_size.y - panel_size.y) / 2;
+               }
+               else if(old_panel_size.y > vid_conheight * 0.999)
+                       panel_pos.y += (old_panel_size.y - panel_size.y) / 2;
        }
        else
                weapon_count = WEP_COUNT;