From: FruitieX Date: Thu, 17 Jun 2010 08:54:59 +0000 (+0300) Subject: terencehill's resizecheck algoritihm. This makes resizing a lot smoother. Fix resizin... X-Git-Tag: xonotic-v0.1.0preview~541^2~21 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=38854e3fc0337fa6ba4d6e2ae4e0d0cdde229124;p=xonotic%2Fxonotic-data.pk3dir.git terencehill's resizecheck algoritihm. This makes resizing a lot smoother. Fix resizing when panel touches another panel and you resize from that panel's other side. This still fails when the grid is on, but that probably means the grid fails (moves the panel slightly inside another panel for some reason) --- diff --git a/qcsrc/client/hud.qc b/qcsrc/client/hud.qc index 3ef20f6cf..e4226e691 100644 --- a/qcsrc/client/hud.qc +++ b/qcsrc/client/hud.qc @@ -1058,13 +1058,13 @@ vector HUD_Panel_CheckResize(float id, vector mySize, vector resizeorigin, float if (resizeCorner == 1) { // check if this panel is on our way - if (resizeorigin_x < targPos_x) + if (resizeorigin_x <= targPos_x) continue; - if (resizeorigin_y < targPos_y) + if (resizeorigin_y <= targPos_y) continue; - if (targEndPos_x < resizeorigin_x - mySize_x) + if (targEndPos_x <= resizeorigin_x - mySize_x) continue; - if (targEndPos_y < resizeorigin_y - mySize_y) + if (targEndPos_y <= resizeorigin_y - mySize_y) continue; // there is a collision: @@ -1082,13 +1082,13 @@ vector HUD_Panel_CheckResize(float id, vector mySize, vector resizeorigin, float } else if (resizeCorner == 2) { - if (resizeorigin_x > targEndPos_x) + if (resizeorigin_x >= targEndPos_x) continue; - if (resizeorigin_y < targPos_y) + if (resizeorigin_y <= targPos_y) continue; - if (targPos_x > resizeorigin_x + mySize_x) + if (targPos_x >= resizeorigin_x + mySize_x) continue; - if (targEndPos_y < resizeorigin_y - mySize_y) + if (targEndPos_y <= resizeorigin_y - mySize_y) continue; dist_x = targPos_x - resizeorigin_x; @@ -1100,13 +1100,13 @@ vector HUD_Panel_CheckResize(float id, vector mySize, vector resizeorigin, float } else if (resizeCorner == 3) { - if (resizeorigin_x < targPos_x) + if (resizeorigin_x <= targPos_x) continue; - if (resizeorigin_y > targEndPos_y) + if (resizeorigin_y >= targEndPos_y) continue; - if (targEndPos_x < resizeorigin_x - mySize_x) + if (targEndPos_x <= resizeorigin_x - mySize_x) continue; - if (targPos_y > resizeorigin_y + mySize_y) + if (targPos_y >= resizeorigin_y + mySize_y) continue; dist_x = resizeorigin_x - targEndPos_x; @@ -1118,13 +1118,13 @@ vector HUD_Panel_CheckResize(float id, vector mySize, vector resizeorigin, float } else if (resizeCorner == 4) { - if (resizeorigin_x > targEndPos_x) + if (resizeorigin_x >= targEndPos_x) continue; - if (resizeorigin_y > targEndPos_y) + if (resizeorigin_y >= targEndPos_y) continue; - if (targPos_x > resizeorigin_x + mySize_x) + if (targPos_x >= resizeorigin_x + mySize_x) continue; - if (targPos_y > resizeorigin_y + mySize_y) + if (targPos_y >= resizeorigin_y + mySize_y) continue; dist_x = targPos_x - resizeorigin_x;