Skip to content

Commit

Permalink
Merge pull request #1284 from nickbetsworth/remove-brush-toggle-buttons
Browse files Browse the repository at this point in the history
Remove brush toggle buttons for AA and feathering
  • Loading branch information
candyface authored Oct 3, 2019
2 parents 9adb617 + f32a464 commit c9fc9a7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 35 deletions.
2 changes: 1 addition & 1 deletion app/src/tooloptionwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,8 @@ void ToolOptionWidget::setVisibility(BaseTool* tool)
ui->sizeSlider->setVisible(tool->isPropertyEnabled(WIDTH));
ui->brushSpinBox->setVisible(tool->isPropertyEnabled(WIDTH));
ui->featherSlider->setVisible(tool->isPropertyEnabled(FEATHER));
ui->useFeatherBox->setVisible(tool->isPropertyEnabled(FEATHER));
ui->featherSpinBox->setVisible(tool->isPropertyEnabled(FEATHER));
ui->useFeatherBox->setVisible(tool->isPropertyEnabled(USEFEATHER));
ui->useBezierBox->setVisible(tool->isPropertyEnabled(BEZIER));
ui->usePressureBox->setVisible(tool->isPropertyEnabled(PRESSURE));
ui->makeInvisibleBox->setVisible(tool->isPropertyEnabled(INVISIBILITY));
Expand Down
35 changes: 3 additions & 32 deletions core_lib/src/tool/brushtool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,24 +49,20 @@ void BrushTool::loadSettings()
{
mPropertyEnabled[WIDTH] = true;
mPropertyEnabled[FEATHER] = true;
mPropertyEnabled[USEFEATHER] = true;
mPropertyEnabled[PRESSURE] = true;
mPropertyEnabled[INVISIBILITY] = true;
mPropertyEnabled[STABILIZATION] = true;
mPropertyEnabled[ANTI_ALIASING] = true;

QSettings settings(PENCIL2D, PENCIL2D);

properties.width = settings.value("brushWidth", 24.0).toDouble();
properties.feather = settings.value("brushFeather", 48.0).toDouble();
properties.useFeather = settings.value("brushUseFeather", true).toBool();
properties.pressure = settings.value("brushPressure", true).toBool();
properties.invisibility = settings.value("brushInvisibility", false).toBool();
properties.preserveAlpha = OFF;
properties.stabilizerLevel = settings.value("brushLineStabilization", StabilizationLevel::STRONG).toInt();
properties.useAA = settings.value("brushAA", 1).toInt();
properties.useAA = DISABLED;

if (properties.useFeather == true) { properties.useAA = -1; }
if (properties.width <= 0) { setWidth(15); }
if (std::isnan(properties.feather)) { setFeather(15); }
}
Expand All @@ -76,7 +72,6 @@ void BrushTool::resetToDefault()
setWidth(24.0);
setFeather(48.0);
setStabilizerLevel(StabilizationLevel::STRONG);
setUseFeather(true);
}

void BrushTool::setWidth(const qreal width)
Expand All @@ -90,17 +85,6 @@ void BrushTool::setWidth(const qreal width)
settings.sync();
}

void BrushTool::setUseFeather(const bool usingFeather)
{
// Set current property
properties.useFeather = usingFeather;

// Update settings
QSettings settings(PENCIL2D, PENCIL2D);
settings.setValue("brushUseFeather", usingFeather);
settings.sync();
}

void BrushTool::setFeather(const qreal feather)
{
// Set current property
Expand Down Expand Up @@ -142,17 +126,6 @@ void BrushTool::setStabilizerLevel(const int level)
settings.sync();
}

void BrushTool::setAA(const int AA)
{
// Set current property
properties.useAA = AA;

// Update settings
QSettings settings(PENCIL2D, PENCIL2D);
settings.setValue("brushAA", AA);
settings.sync();
}

QCursor BrushTool::cursor()
{
if (mEditor->preference()->isOn(SETTING::TOOL_CURSOR))
Expand Down Expand Up @@ -223,8 +196,7 @@ void BrushTool::paintAt(QPointF point)
properties.feather,
mEditor->color()->frontColor(),
opacity,
properties.useFeather,
properties.useAA);
properties.useFeather);

int rad = qRound(brushWidth) / 2 + 2;
mScribbleArea->refreshBitmap(rect, rad);
Expand Down Expand Up @@ -271,8 +243,7 @@ void BrushTool::drawStroke()
properties.feather,
mEditor->color()->frontColor(),
opacity,
properties.useFeather,
properties.useAA);
properties.useFeather);
if (i == (steps - 1))
{
mLastBrushPoint = getCurrentPoint();
Expand Down
2 changes: 0 additions & 2 deletions core_lib/src/tool/brushtool.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,8 @@ class BrushTool : public StrokeTool

void setWidth(const qreal width) override;
void setFeather(const qreal feather) override;
void setUseFeather(const bool usingFeather) override;
void setPressure(const bool pressure) override;
void setInvisibility(const bool invisibility) override;
void setAA(const int useAA) override;
void setStabilizerLevel(const int level) override;

protected:
Expand Down

0 comments on commit c9fc9a7

Please sign in to comment.