Skip to content
  • Julian Sparber's avatar
    clutter/text: Use the PangoLayout y offset for min height calculation · a26fca01
    Julian Sparber authored
    The min height reported by ClutterText when ellipsize and line-wrapping are
    enabled was too small to fit the text.
    
    The coordinates from `pango_layout_get_line_extents()` are baseline relative,
    so the `y` coordinate means that the highest ascent would be `-y` above the
    baseline and height gives the span between the ascent above the baseline and
    the descent below it, so `logical_line_rect.y + logical_line_rect.height`
    gives us the size of the descent. This is the wrong height to use for the
    height of the actor.
    The coordinates of the layout extents don't seems to be related to the baseline
    and are just for offsets when rendering, that's probably how this bug got
    initially introduced.
    Therefore, the `y` coordinate from the layout is the correct offset to use,
    even though, when looking at `pango_layout_get_extends_internal()`, it appears
    that `y` is always set to 0.
    
    Part-of: <!3610>
    a26fca01