docs: Mention baselines
authorMatthias Clasen <mclasen@redhat.com>
Sat, 29 Apr 2023 17:46:47 +0000 (13:46 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Sat, 29 Apr 2023 17:48:03 +0000 (13:48 -0400)
Add a paragraph about baselines to the coordinates overview.

docs/reference/gtk/coordinates.md

index 6c9890cec43104dd005cbcb0f8ce8e92664349d9..afb77e2bdae3a81a0e34e760baf7a1ad543bc212 100644 (file)
@@ -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]