Fix problem using Shift+Pencil tool to draw a straight line with pixel-perfect mode

This commit is contained in:
David Capello 2017-06-19 17:40:31 -03:00
parent a517ed2fff
commit 028fb19b4e

View File

@ -239,6 +239,14 @@ public:
}
void joinStroke(ToolLoop* loop, const Stroke& stroke) override {
// Required for LineFreehand controller in the first stage, when
// we are drawing the line and the trace policy is "Last". Each
// new joinStroke() is like a fresh start. Without this fix, the
// first stage on LineFreehand will draw a "star" like pattern
// with lines from the first point to the last point.
if (loop->getTracePolicy() == TracePolicy::Last)
m_pts.reset();
if (stroke.size() == 0)
return;
else if (m_pts.empty() && stroke.size() == 1) {