@myrmidon/gve-snapshot-rendition 2.0.9 → 2.0.10

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.
@@ -38,7 +38,8 @@ export declare function applyTextStyle(element: SVGTextElement, style: {
38
38
  underline?: number;
39
39
  overline?: number;
40
40
  strike?: number;
41
- rotate?: number;
41
+ textLineStyle?: string;
42
+ textLineColor?: string;
42
43
  }): void;
43
44
  /**
44
45
  * Apply line decoration to text (for custom thickness support).
@@ -85,6 +86,22 @@ export declare function applyTransform(element: SVGElement, transform: {
85
86
  originX?: number;
86
87
  originY?: number;
87
88
  }): void;
89
+ /**
90
+ * Compute the axis-aligned bounding box of a rectangle rotated around a
91
+ * point, using SVG rotation direction (positive = clockwise, y-axis down).
92
+ *
93
+ * Used to cache correct bounds for per-character rotated text: getBBox()
94
+ * returns LOCAL coordinates which ignore the rotate(deg, x, y) transform
95
+ * applied to the element, while getTransformedBBox() would also bake in
96
+ * ancestor transforms (e.g. the pan/zoom viewport), which must stay out
97
+ * of the bounds cache.
98
+ */
99
+ export declare function rotateRectAroundPoint(rect: {
100
+ x: number;
101
+ y: number;
102
+ width: number;
103
+ height: number;
104
+ }, degrees: number, cx: number, cy: number): DOMRect;
88
105
  /**
89
106
  * Calculate the center point of a bounding rectangle.
90
107
  */
@@ -36,6 +36,10 @@ export interface GveRenditionSettings {
36
36
  overline?: number;
37
37
  /** Default strikethrough thickness in pixels (undefined = no strike) */
38
38
  strike?: number;
39
+ /** Default decoration line style: solid, dotted, dashed, wavy (undefined = solid) */
40
+ textLineStyle?: string;
41
+ /** Default decoration line color (undefined = same as text color) */
42
+ textLineColor?: string;
39
43
  /** Fraction of reference character width to use for space width (default: 0.33) */
40
44
  spaceWidthFraction: number;
41
45
  /** Spacing between each character in pixels */
@@ -18,7 +18,11 @@ export declare function escapeHtml(text: string): string;
18
18
  export declare function parseOffset(value: number | string, textHeight: number, textWidth: number): number;
19
19
  /**
20
20
  * Replace placeholders in SVG content.
21
- * Placeholders are in the format {{featureName}}.
21
+ * Placeholders are in the format {{featureName}}, or a fallback chain
22
+ * {{name ?? other ?? ...}}: names are tried left to right and the first one
23
+ * having a variable wins. There is no limit to the number of fallbacks.
24
+ * For instance {{r_fore-color ?? r_color}} resolves to the value of
25
+ * r_fore-color when defined, otherwise to the value of r_color.
22
26
  *
23
27
  * @param svgContent - The SVG content with placeholders
24
28
  * @param variables - Map of variable names to values
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@myrmidon/gve-snapshot-rendition",
3
- "version": "2.0.9",
3
+ "version": "2.0.10",
4
4
  "homepage": "https://github.com/vedph/gve-snapshot-rendition",
5
5
  "repository": {
6
6
  "type": "git",