Skip to content
Permalink
Browse files

Set minimum color tolerance to 0 for bucket tool tolerance slider

The spin box already allowed a value of 0, and it makes sense to
have a 0 option here because it effectively means: only fill
regions with identical color, not give/take 1.
  • Loading branch information...
scribblemaniac committed Apr 12, 2019
1 parent b293c28 commit 4f31fe63019b99861a4281b52c385cd24b204145
Showing with 3 additions and 3 deletions.
  1. +1 −1 app/src/tooloptionwidget.cpp
  2. +1 −1 app/ui/tooloptions.ui
  3. +1 −1 core_lib/src/managers/toolmanager.cpp
@@ -53,7 +53,7 @@ void ToolOptionWidget::initUI()
ui->featherSlider->setValue(settings.value("brushFeather", "5").toDouble());
ui->featherSpinBox->setValue(settings.value("brushFeather", "5").toDouble());

ui->toleranceSlider->init(tr("Color Tolerance"), SpinSlider::LINEAR, SpinSlider::INTEGER, 1, 100);
ui->toleranceSlider->init(tr("Color Tolerance"), SpinSlider::LINEAR, SpinSlider::INTEGER, 0, 100);
ui->toleranceSlider->setValue(settings.value("Tolerance", "50").toInt());
ui->toleranceSpinBox->setValue(settings.value("Tolerance", "50").toInt());
}
@@ -111,7 +111,7 @@
<item>
<widget class="SpinSlider" name="toleranceSlider" native="true">
<property name="toolTip">
<string>The extend to which the color variation will be treated as being equal</string>
<string>The extent to which the color variation will be treated as being equal</string>
</property>
</widget>
</item>
@@ -202,7 +202,7 @@ void ToolManager::setStabilizerLevel(int level)

void ToolManager::setTolerance(int newTolerance)
{
if (newTolerance < 0) { newTolerance = 1; }
newTolerance = qMax(0, newTolerance);

currentTool()->setTolerance(newTolerance);
Q_EMIT toleranceValueChanged(newTolerance);

0 comments on commit 4f31fe6

Please sign in to comment.
You can’t perform that action at this time.