Open matthiasclasen opened 4 years ago
Here is a gtk-side fix for now: https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/2514
Given things like https://gitlab.gnome.org/GNOME/gtk/-/commit/30ab8b3ecac15e22436f6c38c1149e54f42f0d50 it seems existing code relies on the current behaviour. So, is it safe to change this?
When transforming points with projective matrices, we must divide the resulting vector by w, in order to get the normalized result.
This commit fixes graphene_matrix_transform_point, graphene_matrix_transform_point3d and graphene_matrix_transform_bounds. I suspect that some of the remaining transform functions need similar fixes, but they are not used in GTK, so I couldn't verify that.
Before:
After:
Notice how the bounding box for the projectively transformed button is much too small before, and just right after.