emf-converter 4.6.6 → 4.6.7
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 +30 -5
- package/dist/browser.mjs +30 -5
- package/dist/index.js +30 -5
- package/dist/index.mjs +30 -5
- package/package.json +1 -1
package/dist/browser.js
CHANGED
|
@@ -28827,6 +28827,20 @@ var FLAT_SECTOR_BIAS = {
|
|
|
28827
28827
|
function sectorBias(code) {
|
|
28828
28828
|
return code >= 97 ? (code - 97) / 2 - 1.5 : (code - 65) / 2 - 1.5 - 1 / 64;
|
|
28829
28829
|
}
|
|
28830
|
+
var VERTICAL_STEP_EARLY = "120002002002002002202200200200200220220020000022222220000002222220000002222220000";
|
|
28831
|
+
var VERTICAL_STEP_FIRST = 7;
|
|
28832
|
+
function verticalSideOffset(width) {
|
|
28833
|
+
if (width < HOBBY_LIMIT || width > 1400) {
|
|
28834
|
+
return void 0;
|
|
28835
|
+
}
|
|
28836
|
+
let m = VERTICAL_STEP_FIRST;
|
|
28837
|
+
for (let i = 1; i < VERTICAL_STEP_EARLY.length; i++) {
|
|
28838
|
+
if (width >= 16 * (i + VERTICAL_STEP_FIRST) - 7 - +VERTICAL_STEP_EARLY[i]) {
|
|
28839
|
+
m = i + VERTICAL_STEP_FIRST;
|
|
28840
|
+
}
|
|
28841
|
+
}
|
|
28842
|
+
return 8 * m;
|
|
28843
|
+
}
|
|
28830
28844
|
var penCache = /* @__PURE__ */ new Map();
|
|
28831
28845
|
function penPolygon(width) {
|
|
28832
28846
|
const cached = penCache.get(width);
|
|
@@ -28839,7 +28853,7 @@ function penPolygon(width) {
|
|
|
28839
28853
|
pen = HOBBY[n - 1];
|
|
28840
28854
|
} else {
|
|
28841
28855
|
const rx = Math.ceil(width / 2);
|
|
28842
|
-
const ry =
|
|
28856
|
+
const ry = rx;
|
|
28843
28857
|
const f = flattenBezierPath(ellipseBeziers(-rx, -ry, rx, ry));
|
|
28844
28858
|
const half = [];
|
|
28845
28859
|
for (let i = 0; i + 1 < f.length; i += 2) {
|
|
@@ -28917,7 +28931,8 @@ function perpendicularVectors(width, dx0, dy0) {
|
|
|
28917
28931
|
cy = sectorBias(pair.charCodeAt(1));
|
|
28918
28932
|
}
|
|
28919
28933
|
}
|
|
28920
|
-
const
|
|
28934
|
+
const side = dx === 0 ? verticalSideOffset(width) : void 0;
|
|
28935
|
+
const vx = side === void 0 ? r(x + cx) : -side, vy = r(y + cy);
|
|
28921
28936
|
return { v: flip ? [-vx, -vy] : [vx, vy], ray: flip ? [-x, -y] : [x, y] };
|
|
28922
28937
|
}
|
|
28923
28938
|
function squareExtension(width, dx, dy) {
|
|
@@ -29571,6 +29586,14 @@ function brushPaint2(rCtx) {
|
|
|
29571
29586
|
...state.bkMode === 1 && state.brushPattern?.kind === "hatch" ? { skip: hatchBackgroundMask(state.brushPattern.hatch) } : {}
|
|
29572
29587
|
};
|
|
29573
29588
|
}
|
|
29589
|
+
function withoutCurveTangents(path) {
|
|
29590
|
+
if (!path.figures.some((f) => f.tangents)) {
|
|
29591
|
+
return path;
|
|
29592
|
+
}
|
|
29593
|
+
const plain = new GdiRasterPath();
|
|
29594
|
+
plain.figures = path.figures.map((f) => ({ pts: f.pts, closed: f.closed, roundWiden: f.roundWiden }));
|
|
29595
|
+
return plain;
|
|
29596
|
+
}
|
|
29574
29597
|
function layoutRasterPath(rCtx, path, boxShape = false) {
|
|
29575
29598
|
if (!rCtx.wmfLayoutRtl || boxShape) return path;
|
|
29576
29599
|
const shift = Math.round(16 * (rCtx.wholeDevicePixels?.[0] ?? 1));
|
|
@@ -29581,9 +29604,11 @@ function layoutRasterPath(rCtx, path, boxShape = false) {
|
|
|
29581
29604
|
function paintRasterPath(rCtx, path, opts) {
|
|
29582
29605
|
path = layoutRasterPath(rCtx, path, opts.rectangle || opts.roundPen);
|
|
29583
29606
|
const { ctx, state } = rCtx;
|
|
29607
|
+
let filled = !!opts.filled;
|
|
29584
29608
|
if (opts.fill) {
|
|
29585
29609
|
const paint = brushPaint2(rCtx);
|
|
29586
29610
|
if (paint) {
|
|
29611
|
+
filled = true;
|
|
29587
29612
|
const fillPath = opts.fillPath ? layoutRasterPath(rCtx, opts.fillPath, opts.rectangle || opts.roundPen) : path;
|
|
29588
29613
|
const spans = fillPathSpans(fillPath, !!opts.winding);
|
|
29589
29614
|
paintSpansDeferred(rCtx, spans, paint, state.rop2);
|
|
@@ -29596,7 +29621,7 @@ function paintRasterPath(rCtx, path, opts) {
|
|
|
29596
29621
|
if (!penIsWidened(rCtx)) {
|
|
29597
29622
|
return false;
|
|
29598
29623
|
}
|
|
29599
|
-
const polys = widenPath(path, penWidenOptions(rCtx, opts));
|
|
29624
|
+
const polys = widenPath(filled ? withoutCurveTangents(path) : path, penWidenOptions(rCtx, opts));
|
|
29600
29625
|
paintSpansDeferred(rCtx, fillPolygonSpans(polys, true), { kind: "solid", rgb: rgbOf(state.penColor) }, state.rop2);
|
|
29601
29626
|
return true;
|
|
29602
29627
|
}
|
|
@@ -29913,7 +29938,7 @@ function paintGdiShape(rCtx, shape) {
|
|
|
29913
29938
|
return;
|
|
29914
29939
|
}
|
|
29915
29940
|
if ((cosmetic || penIsWidened(rCtx)) && (aliased || bitwise)) {
|
|
29916
|
-
paintRasterPath(rCtx, getPath(), { fill: false, stroke: true, style: shape.style, rectangle: shape.rectangle, roundPen: shape.roundPen });
|
|
29941
|
+
paintRasterPath(rCtx, getPath(), { fill: false, stroke: true, style: shape.style, rectangle: shape.rectangle, roundPen: shape.roundPen, filled: !!shape.fill && state.brushStyle !== 1 });
|
|
29917
29942
|
return;
|
|
29918
29943
|
}
|
|
29919
29944
|
const pattern = cosmeticPattern(rCtx);
|
|
@@ -38818,7 +38843,7 @@ function compatCorner(p, w, h, box) {
|
|
|
38818
38843
|
if ((p.rCtx.state.penStyle & 15) === PS_INSIDEFRAME && !penIsCosmetic(p.rCtx)) {
|
|
38819
38844
|
const penWidth = p.rCtx.state.penWidth * Math.sqrt(Math.abs(m[0] * m[3] - m[1] * m[2])) * 16;
|
|
38820
38845
|
const width = box.x1 - box.x0, height = box.y1 - box.y0;
|
|
38821
|
-
return [Math.min(cw, width + penWidth) * width / (width + penWidth), Math.min(ch, height + penWidth) * height / (height + penWidth)];
|
|
38846
|
+
return [Math.floor(Math.min(cw, width + penWidth) * width / (width + penWidth)), Math.floor(Math.min(ch, height + penWidth) * height / (height + penWidth))];
|
|
38822
38847
|
}
|
|
38823
38848
|
if (!penIsNull(p) && penIsCosmetic(p.rCtx)) {
|
|
38824
38849
|
const width = box.x1 - box.x0, height = box.y1 - box.y0;
|
package/dist/browser.mjs
CHANGED
|
@@ -28825,6 +28825,20 @@ var FLAT_SECTOR_BIAS = {
|
|
|
28825
28825
|
function sectorBias(code) {
|
|
28826
28826
|
return code >= 97 ? (code - 97) / 2 - 1.5 : (code - 65) / 2 - 1.5 - 1 / 64;
|
|
28827
28827
|
}
|
|
28828
|
+
var VERTICAL_STEP_EARLY = "120002002002002002202200200200200220220020000022222220000002222220000002222220000";
|
|
28829
|
+
var VERTICAL_STEP_FIRST = 7;
|
|
28830
|
+
function verticalSideOffset(width) {
|
|
28831
|
+
if (width < HOBBY_LIMIT || width > 1400) {
|
|
28832
|
+
return void 0;
|
|
28833
|
+
}
|
|
28834
|
+
let m = VERTICAL_STEP_FIRST;
|
|
28835
|
+
for (let i = 1; i < VERTICAL_STEP_EARLY.length; i++) {
|
|
28836
|
+
if (width >= 16 * (i + VERTICAL_STEP_FIRST) - 7 - +VERTICAL_STEP_EARLY[i]) {
|
|
28837
|
+
m = i + VERTICAL_STEP_FIRST;
|
|
28838
|
+
}
|
|
28839
|
+
}
|
|
28840
|
+
return 8 * m;
|
|
28841
|
+
}
|
|
28828
28842
|
var penCache = /* @__PURE__ */ new Map();
|
|
28829
28843
|
function penPolygon(width) {
|
|
28830
28844
|
const cached = penCache.get(width);
|
|
@@ -28837,7 +28851,7 @@ function penPolygon(width) {
|
|
|
28837
28851
|
pen = HOBBY[n - 1];
|
|
28838
28852
|
} else {
|
|
28839
28853
|
const rx = Math.ceil(width / 2);
|
|
28840
|
-
const ry =
|
|
28854
|
+
const ry = rx;
|
|
28841
28855
|
const f = flattenBezierPath(ellipseBeziers(-rx, -ry, rx, ry));
|
|
28842
28856
|
const half = [];
|
|
28843
28857
|
for (let i = 0; i + 1 < f.length; i += 2) {
|
|
@@ -28915,7 +28929,8 @@ function perpendicularVectors(width, dx0, dy0) {
|
|
|
28915
28929
|
cy = sectorBias(pair.charCodeAt(1));
|
|
28916
28930
|
}
|
|
28917
28931
|
}
|
|
28918
|
-
const
|
|
28932
|
+
const side = dx === 0 ? verticalSideOffset(width) : void 0;
|
|
28933
|
+
const vx = side === void 0 ? r(x + cx) : -side, vy = r(y + cy);
|
|
28919
28934
|
return { v: flip ? [-vx, -vy] : [vx, vy], ray: flip ? [-x, -y] : [x, y] };
|
|
28920
28935
|
}
|
|
28921
28936
|
function squareExtension(width, dx, dy) {
|
|
@@ -29569,6 +29584,14 @@ function brushPaint2(rCtx) {
|
|
|
29569
29584
|
...state.bkMode === 1 && state.brushPattern?.kind === "hatch" ? { skip: hatchBackgroundMask(state.brushPattern.hatch) } : {}
|
|
29570
29585
|
};
|
|
29571
29586
|
}
|
|
29587
|
+
function withoutCurveTangents(path) {
|
|
29588
|
+
if (!path.figures.some((f) => f.tangents)) {
|
|
29589
|
+
return path;
|
|
29590
|
+
}
|
|
29591
|
+
const plain = new GdiRasterPath();
|
|
29592
|
+
plain.figures = path.figures.map((f) => ({ pts: f.pts, closed: f.closed, roundWiden: f.roundWiden }));
|
|
29593
|
+
return plain;
|
|
29594
|
+
}
|
|
29572
29595
|
function layoutRasterPath(rCtx, path, boxShape = false) {
|
|
29573
29596
|
if (!rCtx.wmfLayoutRtl || boxShape) return path;
|
|
29574
29597
|
const shift = Math.round(16 * (rCtx.wholeDevicePixels?.[0] ?? 1));
|
|
@@ -29579,9 +29602,11 @@ function layoutRasterPath(rCtx, path, boxShape = false) {
|
|
|
29579
29602
|
function paintRasterPath(rCtx, path, opts) {
|
|
29580
29603
|
path = layoutRasterPath(rCtx, path, opts.rectangle || opts.roundPen);
|
|
29581
29604
|
const { ctx, state } = rCtx;
|
|
29605
|
+
let filled = !!opts.filled;
|
|
29582
29606
|
if (opts.fill) {
|
|
29583
29607
|
const paint = brushPaint2(rCtx);
|
|
29584
29608
|
if (paint) {
|
|
29609
|
+
filled = true;
|
|
29585
29610
|
const fillPath = opts.fillPath ? layoutRasterPath(rCtx, opts.fillPath, opts.rectangle || opts.roundPen) : path;
|
|
29586
29611
|
const spans = fillPathSpans(fillPath, !!opts.winding);
|
|
29587
29612
|
paintSpansDeferred(rCtx, spans, paint, state.rop2);
|
|
@@ -29594,7 +29619,7 @@ function paintRasterPath(rCtx, path, opts) {
|
|
|
29594
29619
|
if (!penIsWidened(rCtx)) {
|
|
29595
29620
|
return false;
|
|
29596
29621
|
}
|
|
29597
|
-
const polys = widenPath(path, penWidenOptions(rCtx, opts));
|
|
29622
|
+
const polys = widenPath(filled ? withoutCurveTangents(path) : path, penWidenOptions(rCtx, opts));
|
|
29598
29623
|
paintSpansDeferred(rCtx, fillPolygonSpans(polys, true), { kind: "solid", rgb: rgbOf(state.penColor) }, state.rop2);
|
|
29599
29624
|
return true;
|
|
29600
29625
|
}
|
|
@@ -29911,7 +29936,7 @@ function paintGdiShape(rCtx, shape) {
|
|
|
29911
29936
|
return;
|
|
29912
29937
|
}
|
|
29913
29938
|
if ((cosmetic || penIsWidened(rCtx)) && (aliased || bitwise)) {
|
|
29914
|
-
paintRasterPath(rCtx, getPath(), { fill: false, stroke: true, style: shape.style, rectangle: shape.rectangle, roundPen: shape.roundPen });
|
|
29939
|
+
paintRasterPath(rCtx, getPath(), { fill: false, stroke: true, style: shape.style, rectangle: shape.rectangle, roundPen: shape.roundPen, filled: !!shape.fill && state.brushStyle !== 1 });
|
|
29915
29940
|
return;
|
|
29916
29941
|
}
|
|
29917
29942
|
const pattern = cosmeticPattern(rCtx);
|
|
@@ -38816,7 +38841,7 @@ function compatCorner(p, w, h, box) {
|
|
|
38816
38841
|
if ((p.rCtx.state.penStyle & 15) === PS_INSIDEFRAME && !penIsCosmetic(p.rCtx)) {
|
|
38817
38842
|
const penWidth = p.rCtx.state.penWidth * Math.sqrt(Math.abs(m[0] * m[3] - m[1] * m[2])) * 16;
|
|
38818
38843
|
const width = box.x1 - box.x0, height = box.y1 - box.y0;
|
|
38819
|
-
return [Math.min(cw, width + penWidth) * width / (width + penWidth), Math.min(ch, height + penWidth) * height / (height + penWidth)];
|
|
38844
|
+
return [Math.floor(Math.min(cw, width + penWidth) * width / (width + penWidth)), Math.floor(Math.min(ch, height + penWidth) * height / (height + penWidth))];
|
|
38820
38845
|
}
|
|
38821
38846
|
if (!penIsNull(p) && penIsCosmetic(p.rCtx)) {
|
|
38822
38847
|
const width = box.x1 - box.x0, height = box.y1 - box.y0;
|
package/dist/index.js
CHANGED
|
@@ -28828,6 +28828,20 @@ var FLAT_SECTOR_BIAS = {
|
|
|
28828
28828
|
function sectorBias(code) {
|
|
28829
28829
|
return code >= 97 ? (code - 97) / 2 - 1.5 : (code - 65) / 2 - 1.5 - 1 / 64;
|
|
28830
28830
|
}
|
|
28831
|
+
var VERTICAL_STEP_EARLY = "120002002002002002202200200200200220220020000022222220000002222220000002222220000";
|
|
28832
|
+
var VERTICAL_STEP_FIRST = 7;
|
|
28833
|
+
function verticalSideOffset(width) {
|
|
28834
|
+
if (width < HOBBY_LIMIT || width > 1400) {
|
|
28835
|
+
return void 0;
|
|
28836
|
+
}
|
|
28837
|
+
let m = VERTICAL_STEP_FIRST;
|
|
28838
|
+
for (let i = 1; i < VERTICAL_STEP_EARLY.length; i++) {
|
|
28839
|
+
if (width >= 16 * (i + VERTICAL_STEP_FIRST) - 7 - +VERTICAL_STEP_EARLY[i]) {
|
|
28840
|
+
m = i + VERTICAL_STEP_FIRST;
|
|
28841
|
+
}
|
|
28842
|
+
}
|
|
28843
|
+
return 8 * m;
|
|
28844
|
+
}
|
|
28831
28845
|
var penCache = /* @__PURE__ */ new Map();
|
|
28832
28846
|
function penPolygon(width) {
|
|
28833
28847
|
const cached = penCache.get(width);
|
|
@@ -28840,7 +28854,7 @@ function penPolygon(width) {
|
|
|
28840
28854
|
pen = HOBBY[n - 1];
|
|
28841
28855
|
} else {
|
|
28842
28856
|
const rx = Math.ceil(width / 2);
|
|
28843
|
-
const ry =
|
|
28857
|
+
const ry = rx;
|
|
28844
28858
|
const f = flattenBezierPath(ellipseBeziers(-rx, -ry, rx, ry));
|
|
28845
28859
|
const half = [];
|
|
28846
28860
|
for (let i = 0; i + 1 < f.length; i += 2) {
|
|
@@ -28918,7 +28932,8 @@ function perpendicularVectors(width, dx0, dy0) {
|
|
|
28918
28932
|
cy = sectorBias(pair.charCodeAt(1));
|
|
28919
28933
|
}
|
|
28920
28934
|
}
|
|
28921
|
-
const
|
|
28935
|
+
const side = dx === 0 ? verticalSideOffset(width) : void 0;
|
|
28936
|
+
const vx = side === void 0 ? r(x + cx) : -side, vy = r(y + cy);
|
|
28922
28937
|
return { v: flip ? [-vx, -vy] : [vx, vy], ray: flip ? [-x, -y] : [x, y] };
|
|
28923
28938
|
}
|
|
28924
28939
|
function squareExtension(width, dx, dy) {
|
|
@@ -29572,6 +29587,14 @@ function brushPaint2(rCtx) {
|
|
|
29572
29587
|
...state.bkMode === 1 && state.brushPattern?.kind === "hatch" ? { skip: hatchBackgroundMask(state.brushPattern.hatch) } : {}
|
|
29573
29588
|
};
|
|
29574
29589
|
}
|
|
29590
|
+
function withoutCurveTangents(path) {
|
|
29591
|
+
if (!path.figures.some((f) => f.tangents)) {
|
|
29592
|
+
return path;
|
|
29593
|
+
}
|
|
29594
|
+
const plain = new GdiRasterPath();
|
|
29595
|
+
plain.figures = path.figures.map((f) => ({ pts: f.pts, closed: f.closed, roundWiden: f.roundWiden }));
|
|
29596
|
+
return plain;
|
|
29597
|
+
}
|
|
29575
29598
|
function layoutRasterPath(rCtx, path, boxShape = false) {
|
|
29576
29599
|
if (!rCtx.wmfLayoutRtl || boxShape) return path;
|
|
29577
29600
|
const shift = Math.round(16 * (rCtx.wholeDevicePixels?.[0] ?? 1));
|
|
@@ -29582,9 +29605,11 @@ function layoutRasterPath(rCtx, path, boxShape = false) {
|
|
|
29582
29605
|
function paintRasterPath(rCtx, path, opts) {
|
|
29583
29606
|
path = layoutRasterPath(rCtx, path, opts.rectangle || opts.roundPen);
|
|
29584
29607
|
const { ctx, state } = rCtx;
|
|
29608
|
+
let filled = !!opts.filled;
|
|
29585
29609
|
if (opts.fill) {
|
|
29586
29610
|
const paint = brushPaint2(rCtx);
|
|
29587
29611
|
if (paint) {
|
|
29612
|
+
filled = true;
|
|
29588
29613
|
const fillPath = opts.fillPath ? layoutRasterPath(rCtx, opts.fillPath, opts.rectangle || opts.roundPen) : path;
|
|
29589
29614
|
const spans = fillPathSpans(fillPath, !!opts.winding);
|
|
29590
29615
|
paintSpansDeferred(rCtx, spans, paint, state.rop2);
|
|
@@ -29597,7 +29622,7 @@ function paintRasterPath(rCtx, path, opts) {
|
|
|
29597
29622
|
if (!penIsWidened(rCtx)) {
|
|
29598
29623
|
return false;
|
|
29599
29624
|
}
|
|
29600
|
-
const polys = widenPath(path, penWidenOptions(rCtx, opts));
|
|
29625
|
+
const polys = widenPath(filled ? withoutCurveTangents(path) : path, penWidenOptions(rCtx, opts));
|
|
29601
29626
|
paintSpansDeferred(rCtx, fillPolygonSpans(polys, true), { kind: "solid", rgb: rgbOf(state.penColor) }, state.rop2);
|
|
29602
29627
|
return true;
|
|
29603
29628
|
}
|
|
@@ -29914,7 +29939,7 @@ function paintGdiShape(rCtx, shape) {
|
|
|
29914
29939
|
return;
|
|
29915
29940
|
}
|
|
29916
29941
|
if ((cosmetic || penIsWidened(rCtx)) && (aliased || bitwise)) {
|
|
29917
|
-
paintRasterPath(rCtx, getPath(), { fill: false, stroke: true, style: shape.style, rectangle: shape.rectangle, roundPen: shape.roundPen });
|
|
29942
|
+
paintRasterPath(rCtx, getPath(), { fill: false, stroke: true, style: shape.style, rectangle: shape.rectangle, roundPen: shape.roundPen, filled: !!shape.fill && state.brushStyle !== 1 });
|
|
29918
29943
|
return;
|
|
29919
29944
|
}
|
|
29920
29945
|
const pattern = cosmeticPattern(rCtx);
|
|
@@ -38819,7 +38844,7 @@ function compatCorner(p, w, h, box) {
|
|
|
38819
38844
|
if ((p.rCtx.state.penStyle & 15) === PS_INSIDEFRAME && !penIsCosmetic(p.rCtx)) {
|
|
38820
38845
|
const penWidth = p.rCtx.state.penWidth * Math.sqrt(Math.abs(m[0] * m[3] - m[1] * m[2])) * 16;
|
|
38821
38846
|
const width = box.x1 - box.x0, height = box.y1 - box.y0;
|
|
38822
|
-
return [Math.min(cw, width + penWidth) * width / (width + penWidth), Math.min(ch, height + penWidth) * height / (height + penWidth)];
|
|
38847
|
+
return [Math.floor(Math.min(cw, width + penWidth) * width / (width + penWidth)), Math.floor(Math.min(ch, height + penWidth) * height / (height + penWidth))];
|
|
38823
38848
|
}
|
|
38824
38849
|
if (!penIsNull(p) && penIsCosmetic(p.rCtx)) {
|
|
38825
38850
|
const width = box.x1 - box.x0, height = box.y1 - box.y0;
|
package/dist/index.mjs
CHANGED
|
@@ -28826,6 +28826,20 @@ var FLAT_SECTOR_BIAS = {
|
|
|
28826
28826
|
function sectorBias(code) {
|
|
28827
28827
|
return code >= 97 ? (code - 97) / 2 - 1.5 : (code - 65) / 2 - 1.5 - 1 / 64;
|
|
28828
28828
|
}
|
|
28829
|
+
var VERTICAL_STEP_EARLY = "120002002002002002202200200200200220220020000022222220000002222220000002222220000";
|
|
28830
|
+
var VERTICAL_STEP_FIRST = 7;
|
|
28831
|
+
function verticalSideOffset(width) {
|
|
28832
|
+
if (width < HOBBY_LIMIT || width > 1400) {
|
|
28833
|
+
return void 0;
|
|
28834
|
+
}
|
|
28835
|
+
let m = VERTICAL_STEP_FIRST;
|
|
28836
|
+
for (let i = 1; i < VERTICAL_STEP_EARLY.length; i++) {
|
|
28837
|
+
if (width >= 16 * (i + VERTICAL_STEP_FIRST) - 7 - +VERTICAL_STEP_EARLY[i]) {
|
|
28838
|
+
m = i + VERTICAL_STEP_FIRST;
|
|
28839
|
+
}
|
|
28840
|
+
}
|
|
28841
|
+
return 8 * m;
|
|
28842
|
+
}
|
|
28829
28843
|
var penCache = /* @__PURE__ */ new Map();
|
|
28830
28844
|
function penPolygon(width) {
|
|
28831
28845
|
const cached = penCache.get(width);
|
|
@@ -28838,7 +28852,7 @@ function penPolygon(width) {
|
|
|
28838
28852
|
pen = HOBBY[n - 1];
|
|
28839
28853
|
} else {
|
|
28840
28854
|
const rx = Math.ceil(width / 2);
|
|
28841
|
-
const ry =
|
|
28855
|
+
const ry = rx;
|
|
28842
28856
|
const f = flattenBezierPath(ellipseBeziers(-rx, -ry, rx, ry));
|
|
28843
28857
|
const half = [];
|
|
28844
28858
|
for (let i = 0; i + 1 < f.length; i += 2) {
|
|
@@ -28916,7 +28930,8 @@ function perpendicularVectors(width, dx0, dy0) {
|
|
|
28916
28930
|
cy = sectorBias(pair.charCodeAt(1));
|
|
28917
28931
|
}
|
|
28918
28932
|
}
|
|
28919
|
-
const
|
|
28933
|
+
const side = dx === 0 ? verticalSideOffset(width) : void 0;
|
|
28934
|
+
const vx = side === void 0 ? r(x + cx) : -side, vy = r(y + cy);
|
|
28920
28935
|
return { v: flip ? [-vx, -vy] : [vx, vy], ray: flip ? [-x, -y] : [x, y] };
|
|
28921
28936
|
}
|
|
28922
28937
|
function squareExtension(width, dx, dy) {
|
|
@@ -29570,6 +29585,14 @@ function brushPaint2(rCtx) {
|
|
|
29570
29585
|
...state.bkMode === 1 && state.brushPattern?.kind === "hatch" ? { skip: hatchBackgroundMask(state.brushPattern.hatch) } : {}
|
|
29571
29586
|
};
|
|
29572
29587
|
}
|
|
29588
|
+
function withoutCurveTangents(path) {
|
|
29589
|
+
if (!path.figures.some((f) => f.tangents)) {
|
|
29590
|
+
return path;
|
|
29591
|
+
}
|
|
29592
|
+
const plain = new GdiRasterPath();
|
|
29593
|
+
plain.figures = path.figures.map((f) => ({ pts: f.pts, closed: f.closed, roundWiden: f.roundWiden }));
|
|
29594
|
+
return plain;
|
|
29595
|
+
}
|
|
29573
29596
|
function layoutRasterPath(rCtx, path, boxShape = false) {
|
|
29574
29597
|
if (!rCtx.wmfLayoutRtl || boxShape) return path;
|
|
29575
29598
|
const shift = Math.round(16 * (rCtx.wholeDevicePixels?.[0] ?? 1));
|
|
@@ -29580,9 +29603,11 @@ function layoutRasterPath(rCtx, path, boxShape = false) {
|
|
|
29580
29603
|
function paintRasterPath(rCtx, path, opts) {
|
|
29581
29604
|
path = layoutRasterPath(rCtx, path, opts.rectangle || opts.roundPen);
|
|
29582
29605
|
const { ctx, state } = rCtx;
|
|
29606
|
+
let filled = !!opts.filled;
|
|
29583
29607
|
if (opts.fill) {
|
|
29584
29608
|
const paint = brushPaint2(rCtx);
|
|
29585
29609
|
if (paint) {
|
|
29610
|
+
filled = true;
|
|
29586
29611
|
const fillPath = opts.fillPath ? layoutRasterPath(rCtx, opts.fillPath, opts.rectangle || opts.roundPen) : path;
|
|
29587
29612
|
const spans = fillPathSpans(fillPath, !!opts.winding);
|
|
29588
29613
|
paintSpansDeferred(rCtx, spans, paint, state.rop2);
|
|
@@ -29595,7 +29620,7 @@ function paintRasterPath(rCtx, path, opts) {
|
|
|
29595
29620
|
if (!penIsWidened(rCtx)) {
|
|
29596
29621
|
return false;
|
|
29597
29622
|
}
|
|
29598
|
-
const polys = widenPath(path, penWidenOptions(rCtx, opts));
|
|
29623
|
+
const polys = widenPath(filled ? withoutCurveTangents(path) : path, penWidenOptions(rCtx, opts));
|
|
29599
29624
|
paintSpansDeferred(rCtx, fillPolygonSpans(polys, true), { kind: "solid", rgb: rgbOf(state.penColor) }, state.rop2);
|
|
29600
29625
|
return true;
|
|
29601
29626
|
}
|
|
@@ -29912,7 +29937,7 @@ function paintGdiShape(rCtx, shape) {
|
|
|
29912
29937
|
return;
|
|
29913
29938
|
}
|
|
29914
29939
|
if ((cosmetic || penIsWidened(rCtx)) && (aliased || bitwise)) {
|
|
29915
|
-
paintRasterPath(rCtx, getPath(), { fill: false, stroke: true, style: shape.style, rectangle: shape.rectangle, roundPen: shape.roundPen });
|
|
29940
|
+
paintRasterPath(rCtx, getPath(), { fill: false, stroke: true, style: shape.style, rectangle: shape.rectangle, roundPen: shape.roundPen, filled: !!shape.fill && state.brushStyle !== 1 });
|
|
29916
29941
|
return;
|
|
29917
29942
|
}
|
|
29918
29943
|
const pattern = cosmeticPattern(rCtx);
|
|
@@ -38817,7 +38842,7 @@ function compatCorner(p, w, h, box) {
|
|
|
38817
38842
|
if ((p.rCtx.state.penStyle & 15) === PS_INSIDEFRAME && !penIsCosmetic(p.rCtx)) {
|
|
38818
38843
|
const penWidth = p.rCtx.state.penWidth * Math.sqrt(Math.abs(m[0] * m[3] - m[1] * m[2])) * 16;
|
|
38819
38844
|
const width = box.x1 - box.x0, height = box.y1 - box.y0;
|
|
38820
|
-
return [Math.min(cw, width + penWidth) * width / (width + penWidth), Math.min(ch, height + penWidth) * height / (height + penWidth)];
|
|
38845
|
+
return [Math.floor(Math.min(cw, width + penWidth) * width / (width + penWidth)), Math.floor(Math.min(ch, height + penWidth) * height / (height + penWidth))];
|
|
38821
38846
|
}
|
|
38822
38847
|
if (!penIsNull(p) && penIsCosmetic(p.rCtx)) {
|
|
38823
38848
|
const width = box.x1 - box.x0, height = box.y1 - box.y0;
|