Skip to content

Commit

Permalink
Minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
callaa committed Apr 12, 2017
1 parent 23921c0 commit ed7cb97
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 10 deletions.
12 changes: 6 additions & 6 deletions src/client/tools/brushes.h
Expand Up @@ -26,14 +26,14 @@ namespace tools {
//! Freehand brush tool
class Freehand : public Tool
{
public:
Freehand(ToolController &owner);
public:
Freehand(ToolController &owner);

void begin(const paintcore::Point& point, float zoom);
void motion(const paintcore::Point& point, bool constrain, bool center);
void end();
void begin(const paintcore::Point& point, float zoom) override;
void motion(const paintcore::Point& point, bool constrain, bool center) override;
void end() override;

bool allowSmoothing() const { return true; }
bool allowSmoothing() const override { return true; }
};

}
Expand Down
5 changes: 5 additions & 0 deletions src/desktop/docks/brushpalettedock.cpp
Expand Up @@ -76,6 +76,10 @@ BrushPalette::BrushPalette(QWidget *parent)
return;
}
d->presets->addBrush(d->brushSettings->getCurrentBrushSettings());
d->ui.brushPaletteView->selectionModel()->select(
d->presets->index(d->presets->rowCount()-1, 0),
QItemSelectionModel::ClearAndSelect|QItemSelectionModel::Current
);
});

connect(d->ui.presetSave, &QAbstractButton::clicked, this, [this]() {
Expand All @@ -102,6 +106,7 @@ BrushPalette::BrushPalette(QWidget *parent)
return;
}
d->presets->removeRow(sel.first().row());
d->ui.brushPaletteView->selectionModel()->clear();
});
}

Expand Down
8 changes: 4 additions & 4 deletions src/desktop/toolwidgets/brushsettings.cpp
Expand Up @@ -110,7 +110,7 @@ static paintcore::Brush brushFromProps(const ToolProperties &bp, const ToolPrope
else
b.setSmudge2(b.smudge1());

b.setResmudge(bp.intValue(brushprop::RESMUDGE, 1, 0, 255));
b.setResmudge(bp.intValue(brushprop::RESMUDGE, 3, 0, 255));

// Watercolor mode requires incremental drawing
b.setIncremental(true);
Expand Down Expand Up @@ -383,11 +383,11 @@ void BrushSettings::updateUi()
d->ui.brushhardness0->setValue(brush.intValue(brushprop::HARD2, 100));
d->ui.hardnessPressure->setChecked(brushMode != 0 && brush.boolValue(brushprop::HARD_PRESSURE, false));

d->ui.brushsmudging->setValue(brush.intValue(brushprop::SMUDGE, 100));
d->ui.brushsmudging0->setValue(brush.intValue(brushprop::SMUDGE2, 100));
d->ui.brushsmudging->setValue(brush.intValue(brushprop::SMUDGE, 50));
d->ui.brushsmudging0->setValue(brush.intValue(brushprop::SMUDGE2, 0));
d->ui.smudgingPressure->setChecked(brushMode == 2 && brush.boolValue(brushprop::SMUDGE_PRESSURE, false));

d->ui.colorpickup->setValue(brush.intValue(brushprop::RESMUDGE, 1, 0));
d->ui.colorpickup->setValue(brush.intValue(brushprop::RESMUDGE, 3, 0, 255));

d->ui.brushspacing->setValue(brush.intValue(brushprop::SPACING, 10));
if(brush.boolValue(brushprop::INCREMENTAL, true))
Expand Down

0 comments on commit ed7cb97

Please sign in to comment.