Closed GrounzerLiu closed 3 weeks ago
Bug description
Pango.LayoutLine.get_x_ranges The Pango documentation states that the length of the ranges is 2 * n_ranges.
ranges
2 * n_ranges
pub fn x_ranges(&self, start_index: i32, end_index: i32) -> Vec<i32> { unsafe { let mut ranges = std::ptr::null_mut(); let mut n_ranges = std::mem::MaybeUninit::uninit(); ffi::pango_layout_line_get_x_ranges( self.to_glib_none().0, start_index, end_index, &mut ranges, n_ranges.as_mut_ptr(), ); FromGlibContainer::from_glib_full_num(ranges, n_ranges.assume_init() as _) } }
Here, FromGlibContainer::from_glib_full_num(ranges, n_ranges.assume_init() as _) should be FromGlibContainer::from_glib_full_num(ranges, (2 * n_ranges.assume_init()) as _).
FromGlibContainer::from_glib_full_num(ranges, n_ranges.assume_init() as _)
FromGlibContainer::from_glib_full_num(ranges, (2 * n_ranges.assume_init()) as _)
Thanks, see https://github.com/gtk-rs/gtk-rs-core/pull/1564
Bug description
Pango.LayoutLine.get_x_ranges The Pango documentation states that the length of the
ranges
is2 * n_ranges
.Here,
FromGlibContainer::from_glib_full_num(ranges, n_ranges.assume_init() as _)
should beFromGlibContainer::from_glib_full_num(ranges, (2 * n_ranges.assume_init()) as _)
.