@unmade/text-renderer 0.1.3 → 0.1.4
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.cjs +1 -1
- package/dist/index.js +95 -89
- package/dist/node/index.cjs +3 -3
- package/dist/node/index.js +8 -2
- package/dist/worker/index.cjs +2 -2
- package/dist/worker/index.js +14 -8
- package/package.json +1 -1
package/dist/node/index.js
CHANGED
|
@@ -8826,7 +8826,7 @@ const du = (e) => e === void 0 || e === "flat" ? { type: "flat" } : e === "curve
|
|
|
8826
8826
|
let l = i.y2 - i.y1;
|
|
8827
8827
|
if (s > 0) {
|
|
8828
8828
|
const d = Fr * s;
|
|
8829
|
-
l
|
|
8829
|
+
l += d * 2;
|
|
8830
8830
|
}
|
|
8831
8831
|
const c = l / r.height * r.physicalHeight, p = a[0] / c;
|
|
8832
8832
|
return Fr * p;
|
|
@@ -8996,7 +8996,13 @@ const Fu = {
|
|
|
8996
8996
|
}, Uu = (e) => {
|
|
8997
8997
|
let r = Array.from(e), t = !1;
|
|
8998
8998
|
return r[0] === "#" && (r.shift(), t = !0), r.length === 3 && (r = r.map((n) => `${n}${n}`)), `${t ? "#" : ""}${r.join("").toLowerCase()}`;
|
|
8999
|
-
}, Ur = (e) =>
|
|
8999
|
+
}, Ur = (e) => {
|
|
9000
|
+
const r = typeof e == "string" ? Number.parseInt(e, 10) : e;
|
|
9001
|
+
return Math.max(0, Math.min(255, Math.round(r))).toString(16).padStart(2, "0");
|
|
9002
|
+
}, Mt = (...e) => {
|
|
9003
|
+
const [r, t, n] = Array.isArray(e[0]) ? e[0] : e;
|
|
9004
|
+
return `#${Ur(r)}${Ur(t)}${Ur(n)}`;
|
|
9005
|
+
}, Cu = (e, r, t) => {
|
|
9000
9006
|
if (r === 0) {
|
|
9001
9007
|
const f = Math.round(t * 255);
|
|
9002
9008
|
return [f, f, f];
|