Skip to content

Commit

Permalink
PaintOnTemplateFeature: Fix setupTemplate()
Browse files Browse the repository at this point in the history
Explicitly signal that the template configuration is complete by
setting template state 'Unloaded' before attempting to load the
template file. This is a prerequisite for 'Template::loadTemplateFile'
to update the state to 'Loaded' on success.
Complements aee1057.
Fixes GH-1830 (Cannot add scribble template).
  • Loading branch information
dg0yt committed Dec 29, 2020
1 parent 36d6fb1 commit 7f7060a
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/templates/paint_on_template_feature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,7 @@ Template* PaintOnTemplateFeature::setupTemplate() const
template_image->setTemplateScaleY(1.0/pixel_per_mm);
template_image->setTemplateShear(0);
template_image->setTemplateRotation(0);
template_image->setTemplateState(Template::Unloaded);
template_image->loadTemplateFile();

if (template_image->getTemplateState() != Template::Loaded)
Expand Down

0 comments on commit 7f7060a

Please sign in to comment.