[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:
Emmanuele Bassi 2009-04-15 17:27:04 +01:00
parent 709bb69970
commit d4b47af153

View File

@ -924,6 +924,7 @@ clutter_stage_set_perspective (ClutterStage *stage,
g_return_if_fail (CLUTTER_IS_STAGE (stage));
g_return_if_fail (perspective != NULL);
g_return_if_fail (perspective->z_far - perspective->z_near != 0);
priv = stage->priv;