Răsfoiți Sursa

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 an în urmă
părinte
comite
c521b23619
1 a modificat fișierele cu 4 adăugiri și 0 ștergeri
  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);