@weasel-js/svg 1.15.1 → 1.15.2

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
@@ -1,4 +1,4 @@
1
- import { identity, multiply, pathToD, invert, splitByClosure, fillsOpenSubpaths, rotateAboutPoint, hasOpenSubpath, worldCoords, splitSubpaths, joinPaths } from '@weasel-js/geom';
1
+ import { identity, multiply, pathToD, clamp01, invert, splitByClosure, fillsOpenSubpaths, rotateAboutPoint, hasOpenSubpath, worldCoords, splitSubpaths, applyToPoint, joinPaths } from '@weasel-js/geom';
2
2
  export { pathToD as serializePathD } from '@weasel-js/geom';
3
3
  import { isTileKind, boundsOfPath, transformPath, isSolidPaint, warmFonts, warmPaintKinds, isPaintKindKnown, solid, fillToBoundsFrame, getMarker, registerMarker, dwarn, unionAABB, localizeWorldPoses, createInsertOp, fillInPoseFrame, resolveStroke, pathThroughPoseFrame, resolveFill, pathInPoseFrame, poseLinearOf, poseFrameOf, definesFrame, INHERIT, clipOutline, resolveScreenLength, pathFromD, isPatternPaint, resolveTextStyle, halfLeadingFor, numericWeight, strokeToPath, booleanGroupFields, toRuns, resolveRunFace, derivedDepOf, documentOf, booleanOpOf, DEFAULT_TEXT_FILL, parseColor, rgbaToHex, layoutRuns, resolveRuns, resolveAlign, PathBuilder, PATH_M, PATH_L, PATH_Z, scaleVertexWidth, getPaintKind, resolveMarkerSize, paragraphDirection, scriptMetricsFor, vertexHalfWidths, isImagePatternPaint, isTilePaint, tileSpecOf } from '@weasel-js/core';
4
4
  import { tileGeometry } from '@weasel-js/core/patterns-builtin';
@@ -6,7 +6,8 @@ import { tileGeometry } from '@weasel-js/core/patterns-builtin';
6
6
  // src/types.ts
7
7
  var IDENTITY_MATRIX = identity();
8
8
  function applyMatrix(m, x, y) {
9
- return { x: m[0] * x + m[2] * y + m[4], y: m[1] * x + m[3] * y + m[5] };
9
+ const [px, py] = applyToPoint(m, x, y);
10
+ return { x: px, y: py };
10
11
  }
11
12
  function isIdentity(m, eps = 1e-9) {
12
13
  return Math.abs(m[0] - 1) < eps && Math.abs(m[1]) < eps && Math.abs(m[2]) < eps && Math.abs(m[3] - 1) < eps && Math.abs(m[4]) < eps && Math.abs(m[5]) < eps;
@@ -773,7 +774,6 @@ function dimension(v) {
773
774
  const m = DIMENSION2.exec(v);
774
775
  return m ? { n: Number(m[1]), unit: m[2].toLowerCase() } : void 0;
775
776
  }
776
- var clamp01 = (n) => n < 0 ? 0 : n > 1 ? 1 : n;
777
777
  function pxPer(unit, fontSize) {
778
778
  if (unit === "") return 1;
779
779
  const ems = emsPer(unit);