Browse Source

libobs: Always set initial scene item pos to top-left corner

In relative mode (0, 0) is the center of the screen, so in order to
maintain previous behaviour we need to convert the value here.
derrod 1 year ago
parent
commit
c521b23619
1 changed files with 4 additions and 0 deletions
  1. 4 0
      libobs/obs-scene.c

+ 4 - 0
libobs/obs-scene.c

@@ -2558,6 +2558,10 @@ static obs_sceneitem_t *obs_scene_add_internal(obs_scene_t *scene,
 	matrix4_identity(&item->draw_transform);
 	matrix4_identity(&item->box_transform);
 
+	/* Ensure initial position is still top-left corner in relative mode. */
+	if (!item->absolute_coordinates)
+		pos_from_absolute(&item->pos, &item->pos, item);
+
 	if (source_has_audio(source)) {
 		item->visible = false;
 		da_push_back(item->audio_actions, &action);