UI: Don't attempt to resize parent group when changing cursor

Fixes an issue where resizing a source did not resize the parent group.
This commit is contained in:
Matt Gajownik 2021-03-09 21:15:17 +11:00
parent 513bcb8e35
commit b2fb0ca07f
2 changed files with 5 additions and 5 deletions

View File

@ -395,7 +395,7 @@ static vec2 GetItemSize(obs_sceneitem_t *item)
return size;
}
void OBSBasicPreview::GetStretchHandleData(const vec2 &pos)
void OBSBasicPreview::GetStretchHandleData(const vec2 &pos, bool ignoreGroup)
{
OBSBasic *main = reinterpret_cast<OBSBasic *>(App()->GetMainWindow());
@ -450,7 +450,7 @@ void OBSBasicPreview::GetStretchHandleData(const vec2 &pos)
startCrop.top - startCrop.bottom);
stretchGroup = obs_sceneitem_get_group(scene, stretchItem);
if (stretchGroup) {
if (stretchGroup && !ignoreGroup) {
obs_sceneitem_get_draw_transform(stretchGroup,
&invGroupTransform);
matrix4_inv(&invGroupTransform, &invGroupTransform);
@ -571,7 +571,7 @@ void OBSBasicPreview::mousePressEvent(QMouseEvent *event)
}
vec2_set(&startPos, x, y);
GetStretchHandleData(startPos);
GetStretchHandleData(startPos, false);
vec2_divf(&startPos, &startPos, main->previewScale / pixelRatio);
startPos.x = std::round(startPos.x);
@ -1521,7 +1521,7 @@ void OBSBasicPreview::mouseMoveEvent(QMouseEvent *event)
}
if (updateCursor) {
GetStretchHandleData(startPos);
GetStretchHandleData(startPos, true);
uint32_t stretchFlags = (uint32_t)stretchHandle;
UpdateCursor(stretchFlags);
}

View File

@ -90,7 +90,7 @@ private:
static vec3 GetSnapOffset(const vec3 &tl, const vec3 &br);
void GetStretchHandleData(const vec2 &pos);
void GetStretchHandleData(const vec2 &pos, bool ignoreGroup);
void UpdateCursor(uint32_t &flags);