mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2025-02-19 22:26:20 +00:00
cea608overlay: Update for multiple Pango API changes in gtk-rs-core#308
https://github.com/gtk-rs/gtk-rs-core/pull/308
This commit is contained in:
parent
da4122a721
commit
5ae1f72162
1 changed files with 6 additions and 6 deletions
|
@ -142,20 +142,20 @@ impl Cea608Overlay {
|
||||||
"12345678901234567890123456789012\n2\n3\n4\n5\n6\n7\n8\n9\n0\n1\n2\n3\n4\n5",
|
"12345678901234567890123456789012\n2\n3\n4\n5\n6\n7\n8\n9\n0\n1\n2\n3\n4\n5",
|
||||||
);
|
);
|
||||||
let (_ink_rect, logical_rect) = layout.extents();
|
let (_ink_rect, logical_rect) = layout.extents();
|
||||||
if logical_rect.width > video_info.width() as i32 * pango::SCALE
|
if logical_rect.width() > video_info.width() as i32 * pango::SCALE
|
||||||
|| logical_rect.height > video_info.height() as i32 * pango::SCALE
|
|| logical_rect.height() > video_info.height() as i32 * pango::SCALE
|
||||||
{
|
{
|
||||||
font_desc.set_size((font_size - 1) * pango::SCALE);
|
font_desc.set_size((font_size - 1) * pango::SCALE);
|
||||||
layout.set_font_description(Some(&font_desc));
|
layout.set_font_description(Some(&font_desc));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
left_alignment = (video_info.width() as i32 - logical_rect.width / pango::SCALE) / 2;
|
left_alignment = (video_info.width() as i32 - logical_rect.width() / pango::SCALE) / 2;
|
||||||
font_size += 1;
|
font_size += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if self.settings.lock().unwrap().black_background {
|
if self.settings.lock().unwrap().black_background {
|
||||||
let attrs = pango::AttrList::new();
|
let attrs = pango::AttrList::new();
|
||||||
let attr = pango::Attribute::new_background(0, 0, 0);
|
let attr = pango::AttrColor::new_background(0, 0, 0).upcast();
|
||||||
attrs.insert(attr);
|
attrs.insert(attr);
|
||||||
layout.set_attributes(Some(&attrs));
|
layout.set_attributes(Some(&attrs));
|
||||||
}
|
}
|
||||||
|
@ -171,8 +171,8 @@ impl Cea608Overlay {
|
||||||
let layout = state.layout.as_ref().unwrap();
|
let layout = state.layout.as_ref().unwrap();
|
||||||
layout.set_text(text);
|
layout.set_text(text);
|
||||||
let (_ink_rect, logical_rect) = layout.extents();
|
let (_ink_rect, logical_rect) = layout.extents();
|
||||||
let height = logical_rect.height / pango::SCALE;
|
let height = logical_rect.height() / pango::SCALE;
|
||||||
let width = logical_rect.width / pango::SCALE;
|
let width = logical_rect.width() / pango::SCALE;
|
||||||
|
|
||||||
// No text actually needs rendering
|
// No text actually needs rendering
|
||||||
if width == 0 || height == 0 {
|
if width == 0 || height == 0 {
|
||||||
|
|
Loading…
Reference in a new issue