From f0f9c7bcc821370d34df6880ba6bec6ae5810aec Mon Sep 17 00:00:00 2001 From: Roman Bruckner Date: Mon, 29 Jul 2024 14:59:53 +0200 Subject: [PATCH] update --- packages/joint-core/src/linkTools/RotateLabel.mjs | 3 ++- packages/joint-core/types/joint.d.ts | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/joint-core/src/linkTools/RotateLabel.mjs b/packages/joint-core/src/linkTools/RotateLabel.mjs index a7440324c..c528f3b1d 100644 --- a/packages/joint-core/src/linkTools/RotateLabel.mjs +++ b/packages/joint-core/src/linkTools/RotateLabel.mjs @@ -48,6 +48,7 @@ export const RotateLabel = Control.extend({ getPosition(view) { const { offset = 0 } = this.options; + const { x = 0, y = 0 } = typeof offset === 'number' ? { x: 0, y: offset } : offset; const model = view.model; const index = this.options.labelIndex; const label = model.label(index); @@ -71,7 +72,7 @@ export const RotateLabel = Control.extend({ const matrix = new DOMMatrix() .translate(coords.x, coords.y) .rotate(angle) - .translate(0, offset); + .translate(x, y); return new g.Point(matrix.e, matrix.f); }, diff --git a/packages/joint-core/types/joint.d.ts b/packages/joint-core/types/joint.d.ts index 71dc0e87d..0309c0bac 100644 --- a/packages/joint-core/types/joint.d.ts +++ b/packages/joint-core/types/joint.d.ts @@ -4443,7 +4443,7 @@ export namespace linkTools { namespace RotateLabel { interface Options extends Control.Options { - offset?: number; + offset?: number | dia.Point; buttonColor?: string; iconColor?: string; outlineColor?: string;