瀏覽代碼

UI: Allow alt-cropping on bounding box scene items

Allows the use of alt-cropping on scene items that have bounding box
enabled.  The crop will simply apply to the source within the bounding
box rather than try to do anything fancy.  A simple solution to an
annoying problem.
jp9000 7 年之前
父節點
當前提交
01ac60c760
共有 1 個文件被更改,包括 2 次插入4 次删除
  1. 2 4
      UI/window-basic-preview.cpp

+ 2 - 4
UI/window-basic-preview.cpp

@@ -928,9 +928,6 @@ void OBSBasicPreview::CropItem(const vec2 &pos)
 	uint32_t align = obs_sceneitem_get_alignment(stretchItem);
 	vec3 tl, br, pos3;
 
-	if (boundsType != OBS_BOUNDS_NONE) /* TODO */
-		return;
-
 	vec3_zero(&tl);
 	vec3_set(&br, stretchItemSize.x, stretchItemSize.y, 0.0f);
 
@@ -1035,7 +1032,8 @@ void OBSBasicPreview::CropItem(const vec2 &pos)
 
 	obs_sceneitem_defer_update_begin(stretchItem);
 	obs_sceneitem_set_crop(stretchItem, &crop);
-	obs_sceneitem_set_pos(stretchItem, (vec2*)&newPos);
+	if (boundsType == OBS_BOUNDS_NONE)
+		obs_sceneitem_set_pos(stretchItem, (vec2*)&newPos);
 	obs_sceneitem_defer_update_end(stretchItem);
 }