diff --git a/clutter/clutter-paint-volume.c b/clutter/clutter-paint-volume.c index 8c4c57ede..2e39ac823 100644 --- a/clutter/clutter-paint-volume.c +++ b/clutter/clutter-paint-volume.c @@ -424,8 +424,10 @@ clutter_paint_volume_get_depth (const ClutterPaintVolume *pv) * union * @another_pv: A second #ClutterPaintVolume to union with @pv * - * Updates the geometry of @pv to be the union bounding box that - * encompases @pv and @another_pv. + * Updates the geometry of @pv to encompass @pv and @another_pv. + * + * There are no guarantees about how precisely the two volumes + * will be encompassed. * * Since: 1.6 */ @@ -436,9 +438,11 @@ clutter_paint_volume_union (ClutterPaintVolume *pv, ClutterPaintVolume aligned_pv; g_return_if_fail (pv != NULL); - g_return_if_fail (pv->is_axis_aligned); g_return_if_fail (another_pv != NULL); + /* Both volumes have to belong to the same local coordinate space */ + g_return_if_fail (pv->actor == another_pv->actor); + /* NB: we only have to update vertices 0, 1, 3 and 4 * (See the ClutterPaintVolume typedef for more details) */ @@ -455,6 +459,9 @@ clutter_paint_volume_union (ClutterPaintVolume *pv, goto done; } + if (!pv->is_axis_aligned) + _clutter_paint_volume_axis_align (pv); + if (!another_pv->is_axis_aligned) { _clutter_paint_volume_copy_static (another_pv, &aligned_pv);