clutter/text: Scale down clutter_text_get_cursor_rect to actor coordinates
`priv->cursor_rect` is stored in physical pixels, not local coordinates. So unscale it before returning from `clutter_text_get_cursor_rect`, which is explicitly documented as returning "actor-relative coordinates". This went missed with fractional scaling support, and unnoticed as nobody uses `clutter_text_get_cursor_rect` yet. But that will soon change. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1576>
This commit is contained in:
parent
0bace8dbde
commit
db30a4d7b4
1 changed files with 8 additions and 1 deletions
|
@ -6793,10 +6793,17 @@ void
|
|||
clutter_text_get_cursor_rect (ClutterText *self,
|
||||
graphene_rect_t *rect)
|
||||
{
|
||||
float inverse_scale;
|
||||
|
||||
g_return_if_fail (CLUTTER_IS_TEXT (self));
|
||||
g_return_if_fail (rect != NULL);
|
||||
|
||||
*rect = self->priv->cursor_rect;
|
||||
inverse_scale = 1.f / clutter_actor_get_resource_scale (CLUTTER_ACTOR (self));
|
||||
|
||||
graphene_rect_scale (&self->priv->cursor_rect,
|
||||
inverse_scale,
|
||||
inverse_scale,
|
||||
rect);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
Loading…
Reference in a new issue