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.
This commit is contained in:
Penwywern
2023-07-07 04:47:17 +02:00
committed by Lain
parent 8d0f043ac6
commit a62993d513

View File

@@ -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;