invert fill and stroke painting

Use `cr.fillPreserve, ..., then cr.stroke` instead of `cr.copyPath, ..., cr.stroke, cr.appendPath, cr.fill`
Was there a reason for painting stroke before fill ?
Is something broken ?
This commit is contained in:
abakkk 2020-06-17 15:37:37 +02:00
parent 6a0c0e525a
commit 317f9e4176
1 changed files with 4 additions and 7 deletions

11
draw.js
View File

@ -228,15 +228,12 @@ var DrawingArea = new Lang.Class({
this._findTransformingElement(cr, this.elements[i]);
if (this.elements[i].fill && !isStraightLine) {
let pathCopy = cr.copyPath();
cr.fillPreserve();
if (this.elements[i].shape == Shapes.NONE || this.elements[i].shape == Shapes.LINE)
cr.closePath();
cr.stroke(); // first paint stroke
cr.appendPath(pathCopy);
cr.fill(); // secondly paint fill
} else {
cr.stroke();
}
}
cr.stroke();
cr.restore();
}