Silencing compiler warning in AGGRaster on Visual Studio

This commit is contained in:
Vojtech Bubnik 2021-02-19 18:57:45 +01:00
parent fb7b995050
commit cceaae84fb

View File

@ -147,8 +147,12 @@ public:
, m_renderer(m_raw_renderer) , m_renderer(m_raw_renderer)
, m_trafo(trafo) , m_trafo(trafo)
{ {
m_pxdim_scaled.w_mm /= pd.w_mm; // Visual Studio compiler gives warnings about possible division by zero.
m_pxdim_scaled.h_mm /= pd.h_mm; assert(pd.w_mm != 0 && pd.h_mm != 0);
if (pd.w_mm != 0 && pd.h_mm != 0) {
m_pxdim_scaled.w_mm /= pd.w_mm;
m_pxdim_scaled.h_mm /= pd.h_mm;
}
m_renderer.color(foreground); m_renderer.color(foreground);
clear(background); clear(background);