[pango/line-breaker] Add back pango_layout_iter_get_layout_extents
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pango/line-breaker] Add back pango_layout_iter_get_layout_extents
- Date: Sun, 23 Jan 2022 17:14:37 +0000 (UTC)
commit a364b481a960a6c3bcbc41ef9ebbdc09e7eac307
Author: Matthias Clasen <mclasen redhat com>
Date: Sun Jan 23 11:00:24 2022 -0500
Add back pango_layout_iter_get_layout_extents
pango/pango-layout-iter.c | 18 ++++++++++++++++++
pango/pango-layout-iter.h | 5 +++++
2 files changed, 23 insertions(+)
---
diff --git a/pango/pango-layout-iter.c b/pango/pango-layout-iter.c
index d41c4926..ff07d268 100644
--- a/pango/pango-layout-iter.c
+++ b/pango/pango-layout-iter.c
@@ -595,6 +595,24 @@ offset_run (PangoLayoutIter *iter,
logical_rect->x += iter->run_x;
}
+/**
+ * pango_layout_iter_get_layout_extents:
+ * @iter: a `PangoLayoutIter`
+ * @ink_rect: (out) (optional): rectangle to fill with ink extents
+ * @logical_rect: (out) (optional): rectangle to fill with logical extents
+ *
+ * Obtains the extents of the `PangoLines` being iterated over.
+ */
+void
+pango_layout_iter_get_layout_extents (PangoLayoutIter *iter,
+ PangoRectangle *ink_rect,
+ PangoRectangle *logical_rect)
+{
+ g_return_if_fail (ITER_IS_VALID (iter));
+
+ pango_lines_get_extents (iter->lines, ink_rect, logical_rect);
+}
+
/**
* pango_layout_iter_get_line_extents:
* @iter: a `PangoLayoutIter`
diff --git a/pango/pango-layout-iter.h b/pango/pango-layout-iter.h
index 9c026ca8..3f1b5964 100644
--- a/pango/pango-layout-iter.h
+++ b/pango/pango-layout-iter.h
@@ -44,6 +44,11 @@ gboolean pango_layout_iter_next_cluster (PangoLayoutIter *
PANGO_AVAILABLE_IN_ALL
gboolean pango_layout_iter_next_char (PangoLayoutIter *iter);
+PANGO_AVAILABLE_IN_ALL
+void pango_layout_iter_get_layout_extents (PangoLayoutIter *iter,
+ PangoRectangle *ink_rect,
+ PangoRectangle *logical_rect);
+
PANGO_AVAILABLE_IN_ALL
void pango_layout_iter_get_line_extents (PangoLayoutIter *iter,
PangoRectangle *ink_rect,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]