Skip to content

Commit

Permalink
FillStroke: create gradient if empty #154
Browse files Browse the repository at this point in the history
  • Loading branch information
rodlie committed Jul 6, 2024
1 parent bb5e281 commit b7ab4c6
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/app/GUI/fillstrokesettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,14 @@ void FillStrokeSettingsWidget::setGradientFillAction()
mFillFlatButton->setChecked(false);
mFillNoneButton->setChecked(false);
paintTypeSet(GRADIENTPAINT);

const auto scene = *mDocument.fActiveScene;
if (scene && scene->gradients().count() < 1) {
const auto grad = scene->createNewGradient();
grad->addColor(Qt::black);
grad->addColor(Qt::white);
}

mDocument.actionFinished();
}

Expand Down

0 comments on commit b7ab4c6

Please sign in to comment.