#1223 Put back check for min value, to catch negative values

master
Marius Kintel 2015-02-23 02:17:02 -05:00
parent 878cd0a8d8
commit 0dd3f004dd
1 changed files with 2 additions and 1 deletions

View File

@ -220,10 +220,11 @@ Geometry *SurfaceNode::createGeometry() const
int lines = 0;
int columns = 0;
double min_val = 0;
double min_val = std::numeric_limits<double>::max();
for (img_data_t::iterator it = data.begin();it != data.end();it++) {
lines = std::max(lines, (*it).first.first + 1);
columns = std::max(columns, (*it).first.second + 1);
min_val = std::min((*it).second - 1, min_val);
}
double ox = center ? -(columns-1)/2.0 : 0;