From: Matthias Clasen Date: Sat, 29 Apr 2023 17:46:47 +0000 (-0400) Subject: docs: Mention baselines X-Git-Tag: archive/raspbian/4.12.3+ds-1+rpi1~1^2^2^2~22^2~1^2~336^2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=30b12ff89081882aa15b70a40d7764c58fbba37f;p=gtk4.git docs: Mention baselines Add a paragraph about baselines to the coordinates overview. --- diff --git a/docs/reference/gtk/coordinates.md b/docs/reference/gtk/coordinates.md index 6c9890cec4..afb77e2bda 100644 --- a/docs/reference/gtk/coordinates.md +++ b/docs/reference/gtk/coordinates.md @@ -44,6 +44,10 @@ widgets (although most of the time, the transformation will be a simple 2D trans The transform to go from one widgets coordinate system to another one can be obtained with [method@Gtk.Widget.compute_transform]. +In addition to a size, widgets can optionally have a **_baseline_** to position text on. +Containers such as [class@Gtk.Box] may position their children to match up their baselines. +[method@Gtk.Widget.get_baseline] returns the y position of the baseline in widget coordinates. + When widget APIs expect positions or areas, they need to be expressed in this coordinate system, typically called **_widget coordinates_**. GTK provides a number of APIs to translate between different widgets' coordinate systems, such as [method@Gtk.Widget.compute_point]