mirror of
https://github.com/brl/mutter.git
synced 2024-12-23 19:42:05 +00:00
[stage] Warn if perspective's z_far - z_near is 0
Since we have to do (z_far - z_near) and use it in a division we should check that the user is not passing a value that would cause a division by zero.
This commit is contained in:
parent
709bb69970
commit
d4b47af153
@ -924,6 +924,7 @@ clutter_stage_set_perspective (ClutterStage *stage,
|
|||||||
|
|
||||||
g_return_if_fail (CLUTTER_IS_STAGE (stage));
|
g_return_if_fail (CLUTTER_IS_STAGE (stage));
|
||||||
g_return_if_fail (perspective != NULL);
|
g_return_if_fail (perspective != NULL);
|
||||||
|
g_return_if_fail (perspective->z_far - perspective->z_near != 0);
|
||||||
|
|
||||||
priv = stage->priv;
|
priv = stage->priv;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user