From 317f9e41764ec11332cd9bcc27b51598e28ff65c Mon Sep 17 00:00:00 2001 From: abakkk Date: Wed, 17 Jun 2020 15:37:37 +0200 Subject: [PATCH] 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 ? --- draw.js | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/draw.js b/draw.js index 18385f4..4768b87 100644 --- a/draw.js +++ b/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(); }