Skip to content

Commit 9703c49

Browse files
authored
Merge pull request #571 from songww/add_pango_layoutline_get_runs
pango: Add LayoutLine.runs()
2 parents a3a291a + d8023a1 commit 9703c49

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pango/src/layout.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
use glib::translate::*;
44

5-
use crate::LayoutLine;
5+
use crate::{LayoutLine, LayoutRun};
66

77
// rustdoc-stripper-ignore-next
88
/// The result of [`LayoutLine::x_to_index`].
@@ -66,6 +66,10 @@ impl LayoutLine {
6666
unsafe { (*self.to_glib_none().0).length }
6767
}
6868

69+
#[doc(alias = "pango_layout_line_runs")]
70+
pub fn runs(&self) -> Vec<LayoutRun> {
71+
unsafe { FromGlibPtrContainer::from_glib_none((*self.to_glib_none().0).runs) }
72+
}
6973
#[doc(alias = "pango_layout_line_x_to_index")]
7074
pub fn x_to_index(&self, x_pos: i32) -> HitPosition {
7175
let mut index = 0;

0 commit comments

Comments
 (0)