be explicit about zero-division protection
This commit is contained in:
parent
9556584b0c
commit
cdc6376719
1 changed files with 2 additions and 2 deletions
|
@ -397,9 +397,9 @@ public:
|
||||||
sx_(1.0),
|
sx_(1.0),
|
||||||
sy_(1.0)
|
sy_(1.0)
|
||||||
{
|
{
|
||||||
if (extent_.width())
|
if (extent_.width() > 0)
|
||||||
sx_ = static_cast<double>(width_) / extent_.width();
|
sx_ = static_cast<double>(width_) / extent_.width();
|
||||||
if (extent_.height())
|
if (extent_.height() > 0)
|
||||||
sy_ = static_cast<double>(height_) / extent_.height();
|
sy_ = static_cast<double>(height_) / extent_.height();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue