From b4ddb0df385f0f1ad88210fa15ef958e7eedc3c7 Mon Sep 17 00:00:00 2001 From: mistic100 Date: Mon, 22 Apr 2024 22:22:12 +0200 Subject: [PATCH] Fix #1292 markers: rotation lost when updating marker --- packages/markers-plugin/src/markers/Marker.ts | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/packages/markers-plugin/src/markers/Marker.ts b/packages/markers-plugin/src/markers/Marker.ts index d58d149aa..4de48db41 100644 --- a/packages/markers-plugin/src/markers/Marker.ts +++ b/packages/markers-plugin/src/markers/Marker.ts @@ -160,13 +160,11 @@ export abstract class Marker { this.config.opacity = 1; } - this.config.rotation = 0; - if (!utils.isNil(config.rotation)) { - try { - this.config.rotation = utils.parseAngle(config.rotation); - } catch (e) { - utils.logWarn((e as PSVError).message); - } + try { + this.config.rotation = utils.parseAngle(this.config.rotation ?? 0); + } catch (e) { + utils.logWarn((e as PSVError).message); + this.config.rotation = 0; } this.state.anchor = utils.parsePoint(this.config.anchor);