From 38854e3fc0337fa6ba4d6e2ae4e0d0cdde229124 Mon Sep 17 00:00:00 2001 From: FruitieX Date: Thu, 17 Jun 2010 11:54:59 +0300 Subject: [PATCH] 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) --- qcsrc/client/hud.qc | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) 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; -- 2.39.2