diff options
author | Michael Farrell <micolous+git@gmail.com> | 2021-10-31 12:05:55 +0300 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2021-10-31 13:50:50 +0300 |
commit | 5ae1f721620e38acb6cf2569e2129b39b2282a7e (patch) | |
tree | ea9d7ab1fe1fa2b44d2b9541aac128cde97a94cd /video/closedcaption/src/cea608overlay/imp.rs | |
parent | da4122a7219896b2db2ffe4fd500cf00a99ca243 (diff) |
cea608overlay: Update for multiple Pango API changes in gtk-rs-core#308
https://github.com/gtk-rs/gtk-rs-core/pull/308
Diffstat (limited to 'video/closedcaption/src/cea608overlay/imp.rs')
-rw-r--r-- | video/closedcaption/src/cea608overlay/imp.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/video/closedcaption/src/cea608overlay/imp.rs b/video/closedcaption/src/cea608overlay/imp.rs index b314dad92..bd3376522 100644 --- a/video/closedcaption/src/cea608overlay/imp.rs +++ b/video/closedcaption/src/cea608overlay/imp.rs @@ -142,20 +142,20 @@ impl Cea608Overlay { "12345678901234567890123456789012\n2\n3\n4\n5\n6\n7\n8\n9\n0\n1\n2\n3\n4\n5", ); let (_ink_rect, logical_rect) = layout.extents(); - if logical_rect.width > video_info.width() as i32 * pango::SCALE - || logical_rect.height > video_info.height() 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 { font_desc.set_size((font_size - 1) * pango::SCALE); layout.set_font_description(Some(&font_desc)); 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; } if self.settings.lock().unwrap().black_background { 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); layout.set_attributes(Some(&attrs)); } @@ -171,8 +171,8 @@ impl Cea608Overlay { let layout = state.layout.as_ref().unwrap(); layout.set_text(text); let (_ink_rect, logical_rect) = layout.extents(); - let height = logical_rect.height / pango::SCALE; - let width = logical_rect.width / pango::SCALE; + let height = logical_rect.height() / pango::SCALE; + let width = logical_rect.width() / pango::SCALE; // No text actually needs rendering if width == 0 || height == 0 { |