From a62993d513e00de2d1922ae6166a53657c9fd91d Mon Sep 17 00:00:00 2001 From: Penwywern Date: Fri, 7 Jul 2023 04:47:17 +0200 Subject: [PATCH] UI: Fix drawing of pixel guides on flipped sceneitems in bounding boxes Flip state of the item should be ignored when drawing guides for items in bounding boxes, as the UI uses the countour of the bounding box, not of the flipped item in it. --- UI/window-basic-preview.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/UI/window-basic-preview.cpp b/UI/window-basic-preview.cpp index d0cbcba0f..c3936951d 100644 --- a/UI/window-basic-preview.cpp +++ b/UI/window-basic-preview.cpp @@ -13,7 +13,7 @@ #define HANDLE_RADIUS 4.0f #define HANDLE_SEL_RADIUS (HANDLE_RADIUS * 1.5f) -#define HELPER_ROT_BREAKPONT 45.0f +#define HELPER_ROT_BREAKPOINT 45.0f /* TODO: make C++ math classes and clean up code here later */ @@ -2511,7 +2511,7 @@ void OBSBasicPreview::DrawSpacingHelpers() } // Switch top/bottom or right/left if scale is negative - if (oti.scale.x < 0.0f) { + if (oti.scale.x < 0.0f && oti.bounds_type == OBS_BOUNDS_NONE) { vec3 l = left; vec3 r = right; @@ -2519,7 +2519,7 @@ void OBSBasicPreview::DrawSpacingHelpers() vec3_copy(&right, &l); } - if (oti.scale.y < 0.0f) { + if (oti.scale.y < 0.0f && oti.bounds_type == OBS_BOUNDS_NONE) { vec3 t = top; vec3 b = bottom; @@ -2527,8 +2527,8 @@ void OBSBasicPreview::DrawSpacingHelpers() vec3_copy(&bottom, &t); } - if (rot >= HELPER_ROT_BREAKPONT) { - for (float i = HELPER_ROT_BREAKPONT; i <= 360.0f; i += 90.0f) { + if (rot >= HELPER_ROT_BREAKPOINT) { + for (float i = HELPER_ROT_BREAKPOINT; i <= 360.0f; i += 90.0f) { if (rot < i) break; @@ -2542,8 +2542,8 @@ void OBSBasicPreview::DrawSpacingHelpers() vec3_copy(&bottom, &r); vec3_copy(&left, &b); } - } else if (rot <= -HELPER_ROT_BREAKPONT) { - for (float i = -HELPER_ROT_BREAKPONT; i >= -360.0f; + } else if (rot <= -HELPER_ROT_BREAKPOINT) { + for (float i = -HELPER_ROT_BREAKPOINT; i >= -360.0f; i -= 90.0f) { if (rot > i) break;