From 743ccdd3700842f600fd2b82826adf29ae304f1e Mon Sep 17 00:00:00 2001 From: Dennis Francis Date: Mon, 8 Mar 2021 15:51:45 +0530 Subject: [PATCH] set pen position for all path initiated drawings Signed-off-by: Dennis Francis Change-Id: Iab1c9defa417b03232a53024eaa6f52232244d87 --- loleaflet/src/layer/vector/CPolyline.ts | 4 ++++ loleaflet/src/layer/vector/CanvasOverlay.ts | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/loleaflet/src/layer/vector/CPolyline.ts b/loleaflet/src/layer/vector/CPolyline.ts index dc16abfda..92087230a 100644 --- a/loleaflet/src/layer/vector/CPolyline.ts +++ b/loleaflet/src/layer/vector/CPolyline.ts @@ -41,6 +41,10 @@ class CPolyline extends CPath { if (this.pointSet.empty()) { this.closePopup({}); } + + if (this.renderer) + this.renderer.setPenOnOverlay(); + return this.redraw(oldBounds); } diff --git a/loleaflet/src/layer/vector/CanvasOverlay.ts b/loleaflet/src/layer/vector/CanvasOverlay.ts index 72e3271f1..1e4250219 100644 --- a/loleaflet/src/layer/vector/CanvasOverlay.ts +++ b/loleaflet/src/layer/vector/CanvasOverlay.ts @@ -69,10 +69,15 @@ class CanvasOverlay { return this.overlaySection.getTestDivContainer(); } + setPenOnOverlay() { + this.overlaySection.containerObject.setPenPosition(this.overlaySection); + } + initPath(path: CPath) { var pathId: number = path.getId(); this.paths.set(pathId, path); path.setRenderer(this); + this.setPenOnOverlay(); path.updatePathAllPanes(); }