be explicit about zero-division protection

This commit is contained in:
Dane Springmeyer 2012-03-16 14:49:56 -07:00
parent 9556584b0c
commit cdc6376719

View file

@ -397,9 +397,9 @@ public:
sx_(1.0),
sy_(1.0)
{
if (extent_.width())
if (extent_.width() > 0)
sx_ = static_cast<double>(width_) / extent_.width();
if (extent_.height())
if (extent_.height() > 0)
sy_ = static_cast<double>(height_) / extent_.height();
}