mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-03-28 20:05:38 +00:00
Revert "textoverlay: Do not limit positioning to video area."
This reverts commit a48daf6dd8
.
This changed behaviour in a way that's not always
backwards-compatible.
https://bugzilla.gnome.org/show_bug.cgi?id=761251
This commit is contained in:
parent
747bf12959
commit
241fcaa645
1 changed files with 8 additions and 4 deletions
|
@ -445,8 +445,8 @@ gst_base_text_overlay_class_init (GstBaseTextOverlayClass * klass)
|
|||
*/
|
||||
g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_XPOS,
|
||||
g_param_spec_double ("xpos", "horizontal position",
|
||||
"Horizontal position when using position alignment", -G_MAXDOUBLE,
|
||||
G_MAXDOUBLE, DEFAULT_PROP_XPOS,
|
||||
"Horizontal position when using position alignment", 0, 1.0,
|
||||
DEFAULT_PROP_XPOS,
|
||||
G_PARAM_READWRITE | GST_PARAM_CONTROLLABLE | G_PARAM_STATIC_STRINGS));
|
||||
/**
|
||||
* GstBaseTextOverlay:ypos:
|
||||
|
@ -455,8 +455,8 @@ gst_base_text_overlay_class_init (GstBaseTextOverlayClass * klass)
|
|||
*/
|
||||
g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_YPOS,
|
||||
g_param_spec_double ("ypos", "vertical position",
|
||||
"Vertical position when using position alignment", -G_MAXDOUBLE,
|
||||
G_MAXDOUBLE, DEFAULT_PROP_YPOS,
|
||||
"Vertical position when using position alignment", 0, 1.0,
|
||||
DEFAULT_PROP_YPOS,
|
||||
G_PARAM_READWRITE | GST_PARAM_CONTROLLABLE | G_PARAM_STATIC_STRINGS));
|
||||
g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_WRAP_MODE,
|
||||
g_param_spec_enum ("wrap-mode", "wrap mode",
|
||||
|
@ -1492,6 +1492,9 @@ gst_base_text_overlay_get_pos (GstBaseTextOverlay * overlay,
|
|||
break;
|
||||
case GST_BASE_TEXT_OVERLAY_HALIGN_POS:
|
||||
*xpos += (gint) (overlay->width * overlay->xpos) - width / 2;
|
||||
*xpos = CLAMP (*xpos, 0, overlay->width - overlay->ink_rect.width);
|
||||
if (*xpos < 0)
|
||||
*xpos = 0;
|
||||
break;
|
||||
default:
|
||||
*xpos = 0;
|
||||
|
@ -1516,6 +1519,7 @@ gst_base_text_overlay_get_pos (GstBaseTextOverlay * overlay,
|
|||
break;
|
||||
case GST_BASE_TEXT_OVERLAY_VALIGN_POS:
|
||||
*ypos = (gint) (overlay->height * overlay->ypos) - height / 2;
|
||||
*ypos = CLAMP (*ypos, 0, overlay->height - overlay->ink_rect.height);
|
||||
break;
|
||||
case GST_BASE_TEXT_OVERLAY_VALIGN_CENTER:
|
||||
*ypos = (overlay->height - height) / 2;
|
||||
|
|
Loading…
Reference in a new issue