Commit 26e7831e authored by Jan Möbius's avatar Jan Möbius
Browse files

Improve maximum for sliders

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@7975 383ad7c9-94d9-4d36-a494-682f7c89f535
parent a64474a8
...@@ -74,7 +74,7 @@ void DecimaterPlugin::initializePlugin() ...@@ -74,7 +74,7 @@ void DecimaterPlugin::initializePlugin()
tool_->resize(size); tool_->resize(size);
// connect signals->slots // connect signals->slots
connect(tool_->pbDecimate,SIGNAL(clicked() ),this,SLOT(slot_decimate())); connect(tool_->pbDecimate,SIGNAL(clicked() ),this,SLOT(slot_decimate()));
connect(tool_->roundness,SIGNAL(valueChanged(double) ),this,SLOT(updateRoundness(double)) ); connect(tool_->roundness,SIGNAL(valueChanged(double) ),this,SLOT(updateRoundness(double)) );
connect(tool_->roundnessSlider,SIGNAL(valueChanged(int) ),this,SLOT(updateRoundness(int)) ); connect(tool_->roundnessSlider,SIGNAL(valueChanged(int) ),this,SLOT(updateRoundness(int)) );
...@@ -307,7 +307,7 @@ void DecimaterPlugin::slotUpdateNumVertices() ...@@ -307,7 +307,7 @@ void DecimaterPlugin::slotUpdateNumVertices()
return; return;
} }
int current = 0; int max = 0;
int div = 0; int div = 0;
bool ok; bool ok;
...@@ -322,14 +322,18 @@ void DecimaterPlugin::slotUpdateNumVertices() ...@@ -322,14 +322,18 @@ void DecimaterPlugin::slotUpdateNumVertices()
o_it != PluginFunctions::objectsEnd(); ++o_it) { o_it != PluginFunctions::objectsEnd(); ++o_it) {
current += RPC::callFunctionValue<int> ("info" , "vertexCount",o_it->id()); max = std::max( RPC::callFunctionValue<int> ("info" , "vertexCount",o_it->id()) , max );
div++; div++;
} }
if (div <= 0) if (div <= 0)
tool_->currentNumVertices->setText ("<not available>"); tool_->currentNumVertices->setText ("<not available>");
else else {
tool_->currentNumVertices->setText (QString::number(current / div)); tool_->currentNumVertices->setText (QString::number(max));
tool_->verticesCount->setMaximum(max);
tool_->verticesCountSlider->setMaximum(max);
tool_->verticesCount->setValue(max);
}
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment