@pdfme/schemas 6.1.13-dev.26 → 6.1.13-dev.31

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -9,7 +9,6 @@ import "./tables.js";
9
9
  import "./lists.js";
10
10
  import { DEFAULT_FONT_NAME, ZOOM, b64toUint8Array, getDefaultFont, getFallbackFontName, getInternalLinkTarget, mm2pt, normalizeLinkHref, px2mm } from "@pdfme/common";
11
11
  import { Buffer as Buffer$1 } from "buffer";
12
- import { toRadians } from "@pdfme/pdf-lib";
13
12
  import { Barcode, Calendar, CalendarClock, ChevronDown, Circle, CircleDot, Clock, Image, List, Minus, QrCode, Route, Square, SquareCheck, Table, Type } from "lucide";
14
13
  import jpegJsModule from "jpeg-js";
15
14
  import UPNGModule from "@pdf-lib/upng";
@@ -691,9 +690,13 @@ var shape = {
691
690
  });
692
691
  else if (schema.type === "rectangle") {
693
692
  const radius = schema.radius ?? 0;
693
+ const inset = rotatePoint({
694
+ x: position.x + borderWidth / 2,
695
+ y: position.y + borderWidth / 2
696
+ }, position, rotate.angle);
694
697
  page.drawRectangle({
695
- x: position.x + borderWidth * ((1 - Math.sin(toRadians(rotate))) / 2) + Math.tan(toRadians(rotate)) * Math.PI ** 2,
696
- y: position.y + borderWidth * ((1 + Math.sin(toRadians(rotate))) / 2) + Math.tan(toRadians(rotate)) * Math.PI ** 2,
698
+ x: inset.x,
699
+ y: inset.y,
697
700
  width: width - borderWidth,
698
701
  height: height - borderWidth,
699
702
  ...radius ? { radius: mm2pt(radius) } : {},