diff --git a/src/libslic3r/SLA/AGGRaster.hpp b/src/libslic3r/SLA/AGGRaster.hpp index 487a58252..849cec30a 100644 --- a/src/libslic3r/SLA/AGGRaster.hpp +++ b/src/libslic3r/SLA/AGGRaster.hpp @@ -147,8 +147,12 @@ public: , m_renderer(m_raw_renderer) , m_trafo(trafo) { - m_pxdim_scaled.w_mm /= pd.w_mm; - m_pxdim_scaled.h_mm /= pd.h_mm; + // Visual Studio compiler gives warnings about possible division by zero. + 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); clear(background);