Merge branch 'matthiasc/for-main' into 'main'

textview: Fix a regression in selection drawing

Closes #6931

See merge request GNOME/gtk!7620
This commit is contained in:
Matthias Clasen 2024-08-16 16:06:14 +00:00
commit 3f36ebc6e7
2 changed files with 16 additions and 2 deletions

View File

@ -4166,6 +4166,7 @@ gtk_text_layout_snapshot (GtkTextLayout *layout,
if (have_selection)
{
GtkCssNode *selection_node;
GdkColor text_color;
selection_start_line = gtk_text_iter_get_line (&selection_start);
selection_end_line = gtk_text_iter_get_line (&selection_end);
@ -4175,8 +4176,9 @@ gtk_text_layout_snapshot (GtkTextLayout *layout,
gtk_css_color_to_color (gtk_css_color_value_get_color (style->used->background_color),
&selection_color);
gtk_css_color_to_color (gtk_css_color_value_get_color (style->used->color), &text_color);
draw_selection_text = !gdk_color_is_clear (&crenderer->fg_color);
draw_selection_text = !gdk_color_is_clear (&text_color);
}
else
{

View File

@ -10409,8 +10409,14 @@ gtk_widget_compute_transform (GtkWidget *widget,
for (iter = widget; iter != ancestor; iter = iter->priv->parent)
{
GtkWidgetPrivate *priv = gtk_widget_get_instance_private (iter);
gsk_transform_to_matrix (priv->transform, &tmp);
if (GTK_IS_NATIVE (iter))
{
graphene_matrix_init_identity (out_transform);
return FALSE;
}
gsk_transform_to_matrix (priv->transform, &tmp);
graphene_matrix_multiply (&transform, &tmp, &transform);
}
@ -10427,6 +10433,12 @@ gtk_widget_compute_transform (GtkWidget *widget,
GtkWidgetPrivate *priv = gtk_widget_get_instance_private (iter);
gsk_transform_to_matrix (priv->transform, &tmp);
if (GTK_IS_NATIVE (iter))
{
graphene_matrix_init_identity (out_transform);
return FALSE;
}
graphene_matrix_multiply (&inverse, &tmp, &inverse);
}
if (!graphene_matrix_inverse (&inverse, &inverse))