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:
parent
6a0c0e525a
commit
317f9e4176
11
draw.js
11
draw.js
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue