Преглед на файлове

Fix white ring in ctkMaterialPropertyPreviewLabel

There was some #inf values in the computation because of sqrt(x<0)
Julien Finet преди 14 години
родител
ревизия
bbca36713a
променени са 1 файла, в които са добавени 1 реда и са изтрити 1 реда
  1. 1 1
      Libs/Widgets/ctkMaterialPropertyPreviewLabel.cpp

+ 1 - 1
Libs/Widgets/ctkMaterialPropertyPreviewLabel.cpp

@@ -228,7 +228,7 @@ void ctkMaterialPropertyPreviewLabel::draw(QImage& image)
         QVector3D pt;
         pt.setX( (i-size2) / (size2-1) );
         pt.setY( (j-size2) / (size2-1) );
-        pt.setZ( sqrt(1. - pt.x()*pt.x() - pt.y()*pt.y()) );
+        pt.setZ( sqrt(qMax(1. - pt.x()*pt.x() - pt.y()*pt.y(), 0.)) );
         
         QVector3D normal = pt;
         normal.normalize();