From 90246f4b344bcdfea26da5c504c8feb93119c700 Mon Sep 17 00:00:00 2001 From: huanhuanwa <44698191+huanhuanwa@users.noreply.github.com> Date: Mon, 29 Apr 2024 18:05:16 +0800 Subject: [PATCH] fix(draw): adjust start text position (#861) --- .changeset/tall-jobs-admire.md | 5 +++++ packages/draw/src/engines/basic-shapes/star.ts | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/tall-jobs-admire.md diff --git a/.changeset/tall-jobs-admire.md b/.changeset/tall-jobs-admire.md new file mode 100644 index 000000000..cdef06d0c --- /dev/null +++ b/.changeset/tall-jobs-admire.md @@ -0,0 +1,5 @@ +--- +'@plait/draw': patch +--- + +adjust start text position diff --git a/packages/draw/src/engines/basic-shapes/star.ts b/packages/draw/src/engines/basic-shapes/star.ts index d3c06cf77..96cf5bffc 100644 --- a/packages/draw/src/engines/basic-shapes/star.ts +++ b/packages/draw/src/engines/basic-shapes/star.ts @@ -35,7 +35,7 @@ export const StarEngine: ShapeEngine = createPolygonEngine({ height, width: width > 0 ? width : 0, x: elementRectangle.x + ShapeDefaultSpace.rectangleAndText + strokeWidth + originWidth / 4, - y: elementRectangle.y + (elementRectangle.height * 1) / 5 + ((elementRectangle.height * 4) / 5 - height) / 2 + y: elementRectangle.y + (elementRectangle.height * 1) / 6 + ((elementRectangle.height * 4) / 5 - height) / 2 }; } });