emf-converter 4.4.13 → 4.4.14
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/browser.js +18 -12
- package/dist/browser.mjs +18 -12
- package/dist/index.js +18 -12
- package/dist/index.mjs +18 -12
- package/package.json +1 -1
package/dist/browser.js
CHANGED
|
@@ -28141,7 +28141,7 @@ function drawVertices(pen, dx, dy) {
|
|
|
28141
28141
|
function halfPixel(v) {
|
|
28142
28142
|
return Math.sign(v) * 8 * Math.floor((Math.abs(v) + 4) / 8);
|
|
28143
28143
|
}
|
|
28144
|
-
function
|
|
28144
|
+
function perpendicularVectors(width, dx0, dy0) {
|
|
28145
28145
|
let dx = dx0;
|
|
28146
28146
|
let dy = dy0;
|
|
28147
28147
|
const flip = dx < 0 || dx === 0 && dy < 0;
|
|
@@ -28175,9 +28175,9 @@ function flatVector(width, dx0, dy0) {
|
|
|
28175
28175
|
const ox = off ? sgn * off[0] : 0;
|
|
28176
28176
|
const oy = off ? sgn * off[1] : 0;
|
|
28177
28177
|
const r = (v) => 8 * Math.floor((v + 4) / 8);
|
|
28178
|
-
const
|
|
28179
|
-
const
|
|
28180
|
-
return flip ? [-vx, -vy] : [vx, vy];
|
|
28178
|
+
const x = D[0] + (B[0] - D[0]) * w, y = D[1] + (B[1] - D[1]) * w;
|
|
28179
|
+
const vx = r(x + 0.5 * Math.sign(dy) + ox), vy = r(y + 0.5 * Math.sign(dx) + oy);
|
|
28180
|
+
return { v: flip ? [-vx, -vy] : [vx, vy], ray: flip ? [-x, -y] : [x, y] };
|
|
28181
28181
|
}
|
|
28182
28182
|
function squareExtension(width, dx, dy) {
|
|
28183
28183
|
const len = Math.hypot(dx, dy);
|
|
@@ -28220,7 +28220,8 @@ var Outliner = class {
|
|
|
28220
28220
|
const d = drawDir ?? [dx, dy];
|
|
28221
28221
|
const [L, R] = drawVertices(this.pen, d[0], d[1]);
|
|
28222
28222
|
const perpendicular = this.opts.roundCurveJoins && drawDir ? drawDir : [dx, dy];
|
|
28223
|
-
|
|
28223
|
+
const vectors = perpendicularVectors(this.opts.width, perpendicular[0], perpendicular[1]);
|
|
28224
|
+
return { dx, dy, L, R, v: vectors.v, vRaw: vectors.ray, e: squareExtension(this.opts.width, dx, dy), curveEnd: !!drawDir };
|
|
28224
28225
|
}
|
|
28225
28226
|
push(p, v) {
|
|
28226
28227
|
this.pts.push([p[0] + v[0], p[1] + v[1]]);
|
|
@@ -28316,7 +28317,7 @@ var Outliner = class {
|
|
|
28316
28317
|
if (this.rr) {
|
|
28317
28318
|
this.walk(p, s[from], s[to], false, false);
|
|
28318
28319
|
} else {
|
|
28319
|
-
const A =
|
|
28320
|
+
const A = from === "R" ? s.vRaw : [-s.vRaw[0], -s.vRaw[1]];
|
|
28320
28321
|
this.wedge(p, A, [-A[0], -A[1]], true, false);
|
|
28321
28322
|
}
|
|
28322
28323
|
this.push(p, this.capSide(s, to));
|
|
@@ -28343,6 +28344,8 @@ var Outliner = class {
|
|
|
28343
28344
|
const join = this.opts.roundCurveJoins ? "round" : this.opts.join;
|
|
28344
28345
|
let sa = this.joinSide(a, side);
|
|
28345
28346
|
let sb = this.joinSide(b, side);
|
|
28347
|
+
const rayA = side === "R" ? a.vRaw : [-a.vRaw[0], -a.vRaw[1]];
|
|
28348
|
+
const rayB = side === "R" ? b.vRaw : [-b.vRaw[0], -b.vRaw[1]];
|
|
28346
28349
|
if (this.opts.roundCurveJoins && !this.originalRoundJoinSides && a.curveEnd && b.curveEnd) {
|
|
28347
28350
|
sa = side === "R" ? a.v : [-a.v[0], -a.v[1]];
|
|
28348
28351
|
sb = side === "R" ? b.v : [-b.v[0], -b.v[1]];
|
|
@@ -28363,10 +28366,10 @@ var Outliner = class {
|
|
|
28363
28366
|
this.walk(p, Da, Db, false, incl);
|
|
28364
28367
|
} else {
|
|
28365
28368
|
const anti = sa[0] === -sb[0] && sa[1] === -sb[1];
|
|
28366
|
-
this.wedge(p,
|
|
28369
|
+
this.wedge(p, rayA, rayB, !anti, !anti);
|
|
28367
28370
|
}
|
|
28368
28371
|
} else if (join === "miter") {
|
|
28369
|
-
const m = miterPoint(sa, [a.dx, a.dy], sb, [b.dx, b.dy], width, miterLimit);
|
|
28372
|
+
const m = miterPoint(sa, [a.dx, a.dy], sb, [b.dx, b.dy], width, miterLimit, side);
|
|
28370
28373
|
if (m) {
|
|
28371
28374
|
this.push(p, m);
|
|
28372
28375
|
}
|
|
@@ -28380,7 +28383,7 @@ var Outliner = class {
|
|
|
28380
28383
|
}
|
|
28381
28384
|
if (join === "round" && cap === "flat" && !this.opts.roundCurveJoins) {
|
|
28382
28385
|
this.push(p, sb);
|
|
28383
|
-
this.wedge(p,
|
|
28386
|
+
this.wedge(p, rayB, rayA, false, false);
|
|
28384
28387
|
this.push(p, sa);
|
|
28385
28388
|
this.pts.push([p[0], p[1]]);
|
|
28386
28389
|
}
|
|
@@ -28599,7 +28602,7 @@ function widenPath(path, opts) {
|
|
|
28599
28602
|
}
|
|
28600
28603
|
return out;
|
|
28601
28604
|
}
|
|
28602
|
-
function miterPoint(sa, da, sb, db, width, limit) {
|
|
28605
|
+
function miterPoint(sa, da, sb, db, width, limit, side) {
|
|
28603
28606
|
const den = da[0] * db[1] - da[1] * db[0];
|
|
28604
28607
|
if (den === 0) {
|
|
28605
28608
|
return null;
|
|
@@ -28609,10 +28612,13 @@ function miterPoint(sa, da, sb, db, width, limit) {
|
|
|
28609
28612
|
const t = (wx * db[1] - wy * db[0]) / den;
|
|
28610
28613
|
const mx = sa[0] + da[0] * t;
|
|
28611
28614
|
const my = sa[1] + da[1] * t;
|
|
28612
|
-
|
|
28615
|
+
const x = Math.sign(mx) * Math.floor(Math.abs(mx) + 0.5);
|
|
28616
|
+
const y = Math.sign(my) * Math.floor(Math.abs(my) + 0.5);
|
|
28617
|
+
const pixel = side === "L" ? Math.ceil : Math.floor;
|
|
28618
|
+
if (Math.hypot(pixel(x / 16), pixel(y / 16)) > limit * width / 32) {
|
|
28613
28619
|
return null;
|
|
28614
28620
|
}
|
|
28615
|
-
return [
|
|
28621
|
+
return [x, y];
|
|
28616
28622
|
}
|
|
28617
28623
|
|
|
28618
28624
|
// src/emf-gdi-raster-shapes.ts
|
package/dist/browser.mjs
CHANGED
|
@@ -28139,7 +28139,7 @@ function drawVertices(pen, dx, dy) {
|
|
|
28139
28139
|
function halfPixel(v) {
|
|
28140
28140
|
return Math.sign(v) * 8 * Math.floor((Math.abs(v) + 4) / 8);
|
|
28141
28141
|
}
|
|
28142
|
-
function
|
|
28142
|
+
function perpendicularVectors(width, dx0, dy0) {
|
|
28143
28143
|
let dx = dx0;
|
|
28144
28144
|
let dy = dy0;
|
|
28145
28145
|
const flip = dx < 0 || dx === 0 && dy < 0;
|
|
@@ -28173,9 +28173,9 @@ function flatVector(width, dx0, dy0) {
|
|
|
28173
28173
|
const ox = off ? sgn * off[0] : 0;
|
|
28174
28174
|
const oy = off ? sgn * off[1] : 0;
|
|
28175
28175
|
const r = (v) => 8 * Math.floor((v + 4) / 8);
|
|
28176
|
-
const
|
|
28177
|
-
const
|
|
28178
|
-
return flip ? [-vx, -vy] : [vx, vy];
|
|
28176
|
+
const x = D[0] + (B[0] - D[0]) * w, y = D[1] + (B[1] - D[1]) * w;
|
|
28177
|
+
const vx = r(x + 0.5 * Math.sign(dy) + ox), vy = r(y + 0.5 * Math.sign(dx) + oy);
|
|
28178
|
+
return { v: flip ? [-vx, -vy] : [vx, vy], ray: flip ? [-x, -y] : [x, y] };
|
|
28179
28179
|
}
|
|
28180
28180
|
function squareExtension(width, dx, dy) {
|
|
28181
28181
|
const len = Math.hypot(dx, dy);
|
|
@@ -28218,7 +28218,8 @@ var Outliner = class {
|
|
|
28218
28218
|
const d = drawDir ?? [dx, dy];
|
|
28219
28219
|
const [L, R] = drawVertices(this.pen, d[0], d[1]);
|
|
28220
28220
|
const perpendicular = this.opts.roundCurveJoins && drawDir ? drawDir : [dx, dy];
|
|
28221
|
-
|
|
28221
|
+
const vectors = perpendicularVectors(this.opts.width, perpendicular[0], perpendicular[1]);
|
|
28222
|
+
return { dx, dy, L, R, v: vectors.v, vRaw: vectors.ray, e: squareExtension(this.opts.width, dx, dy), curveEnd: !!drawDir };
|
|
28222
28223
|
}
|
|
28223
28224
|
push(p, v) {
|
|
28224
28225
|
this.pts.push([p[0] + v[0], p[1] + v[1]]);
|
|
@@ -28314,7 +28315,7 @@ var Outliner = class {
|
|
|
28314
28315
|
if (this.rr) {
|
|
28315
28316
|
this.walk(p, s[from], s[to], false, false);
|
|
28316
28317
|
} else {
|
|
28317
|
-
const A =
|
|
28318
|
+
const A = from === "R" ? s.vRaw : [-s.vRaw[0], -s.vRaw[1]];
|
|
28318
28319
|
this.wedge(p, A, [-A[0], -A[1]], true, false);
|
|
28319
28320
|
}
|
|
28320
28321
|
this.push(p, this.capSide(s, to));
|
|
@@ -28341,6 +28342,8 @@ var Outliner = class {
|
|
|
28341
28342
|
const join = this.opts.roundCurveJoins ? "round" : this.opts.join;
|
|
28342
28343
|
let sa = this.joinSide(a, side);
|
|
28343
28344
|
let sb = this.joinSide(b, side);
|
|
28345
|
+
const rayA = side === "R" ? a.vRaw : [-a.vRaw[0], -a.vRaw[1]];
|
|
28346
|
+
const rayB = side === "R" ? b.vRaw : [-b.vRaw[0], -b.vRaw[1]];
|
|
28344
28347
|
if (this.opts.roundCurveJoins && !this.originalRoundJoinSides && a.curveEnd && b.curveEnd) {
|
|
28345
28348
|
sa = side === "R" ? a.v : [-a.v[0], -a.v[1]];
|
|
28346
28349
|
sb = side === "R" ? b.v : [-b.v[0], -b.v[1]];
|
|
@@ -28361,10 +28364,10 @@ var Outliner = class {
|
|
|
28361
28364
|
this.walk(p, Da, Db, false, incl);
|
|
28362
28365
|
} else {
|
|
28363
28366
|
const anti = sa[0] === -sb[0] && sa[1] === -sb[1];
|
|
28364
|
-
this.wedge(p,
|
|
28367
|
+
this.wedge(p, rayA, rayB, !anti, !anti);
|
|
28365
28368
|
}
|
|
28366
28369
|
} else if (join === "miter") {
|
|
28367
|
-
const m = miterPoint(sa, [a.dx, a.dy], sb, [b.dx, b.dy], width, miterLimit);
|
|
28370
|
+
const m = miterPoint(sa, [a.dx, a.dy], sb, [b.dx, b.dy], width, miterLimit, side);
|
|
28368
28371
|
if (m) {
|
|
28369
28372
|
this.push(p, m);
|
|
28370
28373
|
}
|
|
@@ -28378,7 +28381,7 @@ var Outliner = class {
|
|
|
28378
28381
|
}
|
|
28379
28382
|
if (join === "round" && cap === "flat" && !this.opts.roundCurveJoins) {
|
|
28380
28383
|
this.push(p, sb);
|
|
28381
|
-
this.wedge(p,
|
|
28384
|
+
this.wedge(p, rayB, rayA, false, false);
|
|
28382
28385
|
this.push(p, sa);
|
|
28383
28386
|
this.pts.push([p[0], p[1]]);
|
|
28384
28387
|
}
|
|
@@ -28597,7 +28600,7 @@ function widenPath(path, opts) {
|
|
|
28597
28600
|
}
|
|
28598
28601
|
return out;
|
|
28599
28602
|
}
|
|
28600
|
-
function miterPoint(sa, da, sb, db, width, limit) {
|
|
28603
|
+
function miterPoint(sa, da, sb, db, width, limit, side) {
|
|
28601
28604
|
const den = da[0] * db[1] - da[1] * db[0];
|
|
28602
28605
|
if (den === 0) {
|
|
28603
28606
|
return null;
|
|
@@ -28607,10 +28610,13 @@ function miterPoint(sa, da, sb, db, width, limit) {
|
|
|
28607
28610
|
const t = (wx * db[1] - wy * db[0]) / den;
|
|
28608
28611
|
const mx = sa[0] + da[0] * t;
|
|
28609
28612
|
const my = sa[1] + da[1] * t;
|
|
28610
|
-
|
|
28613
|
+
const x = Math.sign(mx) * Math.floor(Math.abs(mx) + 0.5);
|
|
28614
|
+
const y = Math.sign(my) * Math.floor(Math.abs(my) + 0.5);
|
|
28615
|
+
const pixel = side === "L" ? Math.ceil : Math.floor;
|
|
28616
|
+
if (Math.hypot(pixel(x / 16), pixel(y / 16)) > limit * width / 32) {
|
|
28611
28617
|
return null;
|
|
28612
28618
|
}
|
|
28613
|
-
return [
|
|
28619
|
+
return [x, y];
|
|
28614
28620
|
}
|
|
28615
28621
|
|
|
28616
28622
|
// src/emf-gdi-raster-shapes.ts
|
package/dist/index.js
CHANGED
|
@@ -28142,7 +28142,7 @@ function drawVertices(pen, dx, dy) {
|
|
|
28142
28142
|
function halfPixel(v) {
|
|
28143
28143
|
return Math.sign(v) * 8 * Math.floor((Math.abs(v) + 4) / 8);
|
|
28144
28144
|
}
|
|
28145
|
-
function
|
|
28145
|
+
function perpendicularVectors(width, dx0, dy0) {
|
|
28146
28146
|
let dx = dx0;
|
|
28147
28147
|
let dy = dy0;
|
|
28148
28148
|
const flip = dx < 0 || dx === 0 && dy < 0;
|
|
@@ -28176,9 +28176,9 @@ function flatVector(width, dx0, dy0) {
|
|
|
28176
28176
|
const ox = off ? sgn * off[0] : 0;
|
|
28177
28177
|
const oy = off ? sgn * off[1] : 0;
|
|
28178
28178
|
const r = (v) => 8 * Math.floor((v + 4) / 8);
|
|
28179
|
-
const
|
|
28180
|
-
const
|
|
28181
|
-
return flip ? [-vx, -vy] : [vx, vy];
|
|
28179
|
+
const x = D[0] + (B[0] - D[0]) * w, y = D[1] + (B[1] - D[1]) * w;
|
|
28180
|
+
const vx = r(x + 0.5 * Math.sign(dy) + ox), vy = r(y + 0.5 * Math.sign(dx) + oy);
|
|
28181
|
+
return { v: flip ? [-vx, -vy] : [vx, vy], ray: flip ? [-x, -y] : [x, y] };
|
|
28182
28182
|
}
|
|
28183
28183
|
function squareExtension(width, dx, dy) {
|
|
28184
28184
|
const len = Math.hypot(dx, dy);
|
|
@@ -28221,7 +28221,8 @@ var Outliner = class {
|
|
|
28221
28221
|
const d = drawDir ?? [dx, dy];
|
|
28222
28222
|
const [L, R] = drawVertices(this.pen, d[0], d[1]);
|
|
28223
28223
|
const perpendicular = this.opts.roundCurveJoins && drawDir ? drawDir : [dx, dy];
|
|
28224
|
-
|
|
28224
|
+
const vectors = perpendicularVectors(this.opts.width, perpendicular[0], perpendicular[1]);
|
|
28225
|
+
return { dx, dy, L, R, v: vectors.v, vRaw: vectors.ray, e: squareExtension(this.opts.width, dx, dy), curveEnd: !!drawDir };
|
|
28225
28226
|
}
|
|
28226
28227
|
push(p, v) {
|
|
28227
28228
|
this.pts.push([p[0] + v[0], p[1] + v[1]]);
|
|
@@ -28317,7 +28318,7 @@ var Outliner = class {
|
|
|
28317
28318
|
if (this.rr) {
|
|
28318
28319
|
this.walk(p, s[from], s[to], false, false);
|
|
28319
28320
|
} else {
|
|
28320
|
-
const A =
|
|
28321
|
+
const A = from === "R" ? s.vRaw : [-s.vRaw[0], -s.vRaw[1]];
|
|
28321
28322
|
this.wedge(p, A, [-A[0], -A[1]], true, false);
|
|
28322
28323
|
}
|
|
28323
28324
|
this.push(p, this.capSide(s, to));
|
|
@@ -28344,6 +28345,8 @@ var Outliner = class {
|
|
|
28344
28345
|
const join = this.opts.roundCurveJoins ? "round" : this.opts.join;
|
|
28345
28346
|
let sa = this.joinSide(a, side);
|
|
28346
28347
|
let sb = this.joinSide(b, side);
|
|
28348
|
+
const rayA = side === "R" ? a.vRaw : [-a.vRaw[0], -a.vRaw[1]];
|
|
28349
|
+
const rayB = side === "R" ? b.vRaw : [-b.vRaw[0], -b.vRaw[1]];
|
|
28347
28350
|
if (this.opts.roundCurveJoins && !this.originalRoundJoinSides && a.curveEnd && b.curveEnd) {
|
|
28348
28351
|
sa = side === "R" ? a.v : [-a.v[0], -a.v[1]];
|
|
28349
28352
|
sb = side === "R" ? b.v : [-b.v[0], -b.v[1]];
|
|
@@ -28364,10 +28367,10 @@ var Outliner = class {
|
|
|
28364
28367
|
this.walk(p, Da, Db, false, incl);
|
|
28365
28368
|
} else {
|
|
28366
28369
|
const anti = sa[0] === -sb[0] && sa[1] === -sb[1];
|
|
28367
|
-
this.wedge(p,
|
|
28370
|
+
this.wedge(p, rayA, rayB, !anti, !anti);
|
|
28368
28371
|
}
|
|
28369
28372
|
} else if (join === "miter") {
|
|
28370
|
-
const m = miterPoint(sa, [a.dx, a.dy], sb, [b.dx, b.dy], width, miterLimit);
|
|
28373
|
+
const m = miterPoint(sa, [a.dx, a.dy], sb, [b.dx, b.dy], width, miterLimit, side);
|
|
28371
28374
|
if (m) {
|
|
28372
28375
|
this.push(p, m);
|
|
28373
28376
|
}
|
|
@@ -28381,7 +28384,7 @@ var Outliner = class {
|
|
|
28381
28384
|
}
|
|
28382
28385
|
if (join === "round" && cap === "flat" && !this.opts.roundCurveJoins) {
|
|
28383
28386
|
this.push(p, sb);
|
|
28384
|
-
this.wedge(p,
|
|
28387
|
+
this.wedge(p, rayB, rayA, false, false);
|
|
28385
28388
|
this.push(p, sa);
|
|
28386
28389
|
this.pts.push([p[0], p[1]]);
|
|
28387
28390
|
}
|
|
@@ -28600,7 +28603,7 @@ function widenPath(path, opts) {
|
|
|
28600
28603
|
}
|
|
28601
28604
|
return out;
|
|
28602
28605
|
}
|
|
28603
|
-
function miterPoint(sa, da, sb, db, width, limit) {
|
|
28606
|
+
function miterPoint(sa, da, sb, db, width, limit, side) {
|
|
28604
28607
|
const den = da[0] * db[1] - da[1] * db[0];
|
|
28605
28608
|
if (den === 0) {
|
|
28606
28609
|
return null;
|
|
@@ -28610,10 +28613,13 @@ function miterPoint(sa, da, sb, db, width, limit) {
|
|
|
28610
28613
|
const t = (wx * db[1] - wy * db[0]) / den;
|
|
28611
28614
|
const mx = sa[0] + da[0] * t;
|
|
28612
28615
|
const my = sa[1] + da[1] * t;
|
|
28613
|
-
|
|
28616
|
+
const x = Math.sign(mx) * Math.floor(Math.abs(mx) + 0.5);
|
|
28617
|
+
const y = Math.sign(my) * Math.floor(Math.abs(my) + 0.5);
|
|
28618
|
+
const pixel = side === "L" ? Math.ceil : Math.floor;
|
|
28619
|
+
if (Math.hypot(pixel(x / 16), pixel(y / 16)) > limit * width / 32) {
|
|
28614
28620
|
return null;
|
|
28615
28621
|
}
|
|
28616
|
-
return [
|
|
28622
|
+
return [x, y];
|
|
28617
28623
|
}
|
|
28618
28624
|
|
|
28619
28625
|
// src/emf-gdi-raster-shapes.ts
|
package/dist/index.mjs
CHANGED
|
@@ -28140,7 +28140,7 @@ function drawVertices(pen, dx, dy) {
|
|
|
28140
28140
|
function halfPixel(v) {
|
|
28141
28141
|
return Math.sign(v) * 8 * Math.floor((Math.abs(v) + 4) / 8);
|
|
28142
28142
|
}
|
|
28143
|
-
function
|
|
28143
|
+
function perpendicularVectors(width, dx0, dy0) {
|
|
28144
28144
|
let dx = dx0;
|
|
28145
28145
|
let dy = dy0;
|
|
28146
28146
|
const flip = dx < 0 || dx === 0 && dy < 0;
|
|
@@ -28174,9 +28174,9 @@ function flatVector(width, dx0, dy0) {
|
|
|
28174
28174
|
const ox = off ? sgn * off[0] : 0;
|
|
28175
28175
|
const oy = off ? sgn * off[1] : 0;
|
|
28176
28176
|
const r = (v) => 8 * Math.floor((v + 4) / 8);
|
|
28177
|
-
const
|
|
28178
|
-
const
|
|
28179
|
-
return flip ? [-vx, -vy] : [vx, vy];
|
|
28177
|
+
const x = D[0] + (B[0] - D[0]) * w, y = D[1] + (B[1] - D[1]) * w;
|
|
28178
|
+
const vx = r(x + 0.5 * Math.sign(dy) + ox), vy = r(y + 0.5 * Math.sign(dx) + oy);
|
|
28179
|
+
return { v: flip ? [-vx, -vy] : [vx, vy], ray: flip ? [-x, -y] : [x, y] };
|
|
28180
28180
|
}
|
|
28181
28181
|
function squareExtension(width, dx, dy) {
|
|
28182
28182
|
const len = Math.hypot(dx, dy);
|
|
@@ -28219,7 +28219,8 @@ var Outliner = class {
|
|
|
28219
28219
|
const d = drawDir ?? [dx, dy];
|
|
28220
28220
|
const [L, R] = drawVertices(this.pen, d[0], d[1]);
|
|
28221
28221
|
const perpendicular = this.opts.roundCurveJoins && drawDir ? drawDir : [dx, dy];
|
|
28222
|
-
|
|
28222
|
+
const vectors = perpendicularVectors(this.opts.width, perpendicular[0], perpendicular[1]);
|
|
28223
|
+
return { dx, dy, L, R, v: vectors.v, vRaw: vectors.ray, e: squareExtension(this.opts.width, dx, dy), curveEnd: !!drawDir };
|
|
28223
28224
|
}
|
|
28224
28225
|
push(p, v) {
|
|
28225
28226
|
this.pts.push([p[0] + v[0], p[1] + v[1]]);
|
|
@@ -28315,7 +28316,7 @@ var Outliner = class {
|
|
|
28315
28316
|
if (this.rr) {
|
|
28316
28317
|
this.walk(p, s[from], s[to], false, false);
|
|
28317
28318
|
} else {
|
|
28318
|
-
const A =
|
|
28319
|
+
const A = from === "R" ? s.vRaw : [-s.vRaw[0], -s.vRaw[1]];
|
|
28319
28320
|
this.wedge(p, A, [-A[0], -A[1]], true, false);
|
|
28320
28321
|
}
|
|
28321
28322
|
this.push(p, this.capSide(s, to));
|
|
@@ -28342,6 +28343,8 @@ var Outliner = class {
|
|
|
28342
28343
|
const join = this.opts.roundCurveJoins ? "round" : this.opts.join;
|
|
28343
28344
|
let sa = this.joinSide(a, side);
|
|
28344
28345
|
let sb = this.joinSide(b, side);
|
|
28346
|
+
const rayA = side === "R" ? a.vRaw : [-a.vRaw[0], -a.vRaw[1]];
|
|
28347
|
+
const rayB = side === "R" ? b.vRaw : [-b.vRaw[0], -b.vRaw[1]];
|
|
28345
28348
|
if (this.opts.roundCurveJoins && !this.originalRoundJoinSides && a.curveEnd && b.curveEnd) {
|
|
28346
28349
|
sa = side === "R" ? a.v : [-a.v[0], -a.v[1]];
|
|
28347
28350
|
sb = side === "R" ? b.v : [-b.v[0], -b.v[1]];
|
|
@@ -28362,10 +28365,10 @@ var Outliner = class {
|
|
|
28362
28365
|
this.walk(p, Da, Db, false, incl);
|
|
28363
28366
|
} else {
|
|
28364
28367
|
const anti = sa[0] === -sb[0] && sa[1] === -sb[1];
|
|
28365
|
-
this.wedge(p,
|
|
28368
|
+
this.wedge(p, rayA, rayB, !anti, !anti);
|
|
28366
28369
|
}
|
|
28367
28370
|
} else if (join === "miter") {
|
|
28368
|
-
const m = miterPoint(sa, [a.dx, a.dy], sb, [b.dx, b.dy], width, miterLimit);
|
|
28371
|
+
const m = miterPoint(sa, [a.dx, a.dy], sb, [b.dx, b.dy], width, miterLimit, side);
|
|
28369
28372
|
if (m) {
|
|
28370
28373
|
this.push(p, m);
|
|
28371
28374
|
}
|
|
@@ -28379,7 +28382,7 @@ var Outliner = class {
|
|
|
28379
28382
|
}
|
|
28380
28383
|
if (join === "round" && cap === "flat" && !this.opts.roundCurveJoins) {
|
|
28381
28384
|
this.push(p, sb);
|
|
28382
|
-
this.wedge(p,
|
|
28385
|
+
this.wedge(p, rayB, rayA, false, false);
|
|
28383
28386
|
this.push(p, sa);
|
|
28384
28387
|
this.pts.push([p[0], p[1]]);
|
|
28385
28388
|
}
|
|
@@ -28598,7 +28601,7 @@ function widenPath(path, opts) {
|
|
|
28598
28601
|
}
|
|
28599
28602
|
return out;
|
|
28600
28603
|
}
|
|
28601
|
-
function miterPoint(sa, da, sb, db, width, limit) {
|
|
28604
|
+
function miterPoint(sa, da, sb, db, width, limit, side) {
|
|
28602
28605
|
const den = da[0] * db[1] - da[1] * db[0];
|
|
28603
28606
|
if (den === 0) {
|
|
28604
28607
|
return null;
|
|
@@ -28608,10 +28611,13 @@ function miterPoint(sa, da, sb, db, width, limit) {
|
|
|
28608
28611
|
const t = (wx * db[1] - wy * db[0]) / den;
|
|
28609
28612
|
const mx = sa[0] + da[0] * t;
|
|
28610
28613
|
const my = sa[1] + da[1] * t;
|
|
28611
|
-
|
|
28614
|
+
const x = Math.sign(mx) * Math.floor(Math.abs(mx) + 0.5);
|
|
28615
|
+
const y = Math.sign(my) * Math.floor(Math.abs(my) + 0.5);
|
|
28616
|
+
const pixel = side === "L" ? Math.ceil : Math.floor;
|
|
28617
|
+
if (Math.hypot(pixel(x / 16), pixel(y / 16)) > limit * width / 32) {
|
|
28612
28618
|
return null;
|
|
28613
28619
|
}
|
|
28614
|
-
return [
|
|
28620
|
+
return [x, y];
|
|
28615
28621
|
}
|
|
28616
28622
|
|
|
28617
28623
|
// src/emf-gdi-raster-shapes.ts
|