Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
kumilingus committed Jul 29, 2024
1 parent 07f018d commit f0f9c7b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion packages/joint-core/src/linkTools/RotateLabel.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
},

Expand Down
2 changes: 1 addition & 1 deletion packages/joint-core/types/joint.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit f0f9c7b

Please sign in to comment.