Commit Graph

2 Commits

Author SHA1 Message Date
Marco Trevisan (Treviño)
af3662775e clutter/text: Generate resource scaled text and paint it at proper scaling
When resource scale is set we need to generate a scaled PangoLayout (by adding
a new scale attribute, or adjusting the one we already have according the
resource scale), then it has to be painted with proper scaling matrix.

So everything that has to do with PangoLayout has to be in real coordinates,
then clutter logical coords multiplied by resource scaling.
While the actual size of the layout is the one of the PangoLayout divided by
resource scale.

We map the text positions to logical coords by default, while using
the pixel coordinates when painting.

We fall back to scale 1 when calculating preferred size if no scale is
known. The pango layout will not have set a layout scale attribute,
meaning it'll be 1, thus we should just assume the layout scale is 1 here.
Not doing so might result in the preferred size being 0x0 meaning the
actor won't be laid out properly.

Fixes https://gitlab.gnome.org/GNOME/mutter/issues/135

https://bugzilla.gnome.org/show_bug.cgi?id=765011
https://gitlab.gnome.org/GNOME/mutter/merge_requests/3
2019-03-01 17:46:49 +00:00
Rui Matos
9710e4a8c0 move everything into a clutter/ directory 2016-04-12 20:04:26 +02:00