mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-14 12:41:07 +00:00
Replace uses of graphene_matrix_transform_
Replace our uses of graphene_matrix_transform_point, _point3d and _bounds by our own versions that handle projective transforms correctly. This fixes render node bounds being incorrect for widgets involving projective transforms (e.g. testrevealer swing transformations), and also fixes picking on such widgets.
This commit is contained in:
parent
99a7a2188a
commit
e36b594867
@ -1822,7 +1822,7 @@ gsk_transform_transform_bounds (GskTransform *self,
|
|||||||
graphene_matrix_t mat;
|
graphene_matrix_t mat;
|
||||||
|
|
||||||
gsk_transform_to_matrix (self, &mat);
|
gsk_transform_to_matrix (self, &mat);
|
||||||
graphene_matrix_transform_bounds (&mat, rect, out_rect);
|
gsk_matrix_transform_bounds (&mat, rect, out_rect);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -1878,7 +1878,7 @@ gsk_transform_transform_point (GskTransform *self,
|
|||||||
graphene_matrix_t mat;
|
graphene_matrix_t mat;
|
||||||
|
|
||||||
gsk_transform_to_matrix (self, &mat);
|
gsk_transform_to_matrix (self, &mat);
|
||||||
graphene_matrix_transform_point (&mat, point, out_point);
|
gsk_matrix_transform_point (&mat, point, out_point);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -4050,7 +4050,7 @@ gtk_widget_compute_point (GtkWidget *widget,
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
graphene_matrix_transform_point (&transform, point, out_point);
|
gsk_matrix_transform_point (&transform, point, out_point);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
@ -9370,8 +9370,8 @@ gtk_widget_do_pick (GtkWidget *widget,
|
|||||||
gsk_transform_unref (transform);
|
gsk_transform_unref (transform);
|
||||||
graphene_point3d_init (&p0, x, y, 0);
|
graphene_point3d_init (&p0, x, y, 0);
|
||||||
graphene_point3d_init (&p1, x, y, 1);
|
graphene_point3d_init (&p1, x, y, 1);
|
||||||
graphene_matrix_transform_point3d (&inv, &p0, &p0);
|
gsk_matrix_transform_point3d (&inv, &p0, &p0);
|
||||||
graphene_matrix_transform_point3d (&inv, &p1, &p1);
|
gsk_matrix_transform_point3d (&inv, &p1, &p1);
|
||||||
if (fabs (p0.z - p1.z) < 1.f / 4096)
|
if (fabs (p0.z - p1.z) < 1.f / 4096)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
@ -9547,9 +9547,9 @@ gtk_widget_compute_bounds (GtkWidget *widget,
|
|||||||
}
|
}
|
||||||
|
|
||||||
gtk_css_boxes_init (&boxes, widget);
|
gtk_css_boxes_init (&boxes, widget);
|
||||||
graphene_matrix_transform_bounds (&transform,
|
gsk_matrix_transform_bounds (&transform,
|
||||||
gtk_css_boxes_get_border_rect (&boxes),
|
gtk_css_boxes_get_border_rect (&boxes),
|
||||||
out_bounds);
|
out_bounds);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user