dgeoutils 2.3.1 → 2.3.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/README.md +2 -0
- package/dist/cjs/DPolygon.d.ts +1 -1
- package/dist/cjs/DPolygon.js +29 -29
- package/dist/es2015/DPolygon.js +29 -29
- package/dist/esm/DPolygon.js +29 -29
- package/dist/umd/dgeoutils.js +30 -30
- package/dist/umd/dgeoutils.min.js +1 -1
- package/dist/umd/dgeoutils.min.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
package/dist/cjs/DPolygon.d.ts
CHANGED
|
@@ -87,7 +87,7 @@ export declare class DPolygon {
|
|
|
87
87
|
removePart(index: number, count: number): DPoint[];
|
|
88
88
|
hasSimpleIntersection(p: DPolygon): boolean;
|
|
89
89
|
simpleInclude(p: DPoint): boolean;
|
|
90
|
-
drawPolygonOnCanvas(canvas: HTMLCanvasElement | OffscreenCanvas, fillColor?: string, strokeColor?: string, shadowColor?: string, lineWidth?: number, steps?: number):
|
|
90
|
+
drawPolygonOnCanvas(canvas: HTMLCanvasElement | OffscreenCanvas, fillColor?: string, strokeColor?: string, shadowColor?: string, lineWidth?: number, steps?: number): DPolygon;
|
|
91
91
|
clearPolygonOnCanvas(canvas: HTMLCanvasElement | OffscreenCanvas): void;
|
|
92
92
|
contain(p: DPoint, isBorderInside?: boolean): boolean;
|
|
93
93
|
onBorder(p: DPoint): boolean;
|
package/dist/cjs/DPolygon.js
CHANGED
|
@@ -827,36 +827,36 @@ var DPolygon = (function () {
|
|
|
827
827
|
DPolygon.prototype.drawPolygonOnCanvas = function (canvas, fillColor, strokeColor, shadowColor, lineWidth, steps) {
|
|
828
828
|
if (lineWidth === void 0) { lineWidth = 1; }
|
|
829
829
|
if (steps === void 0) { steps = this.length - 1; }
|
|
830
|
-
if (this.length
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
ctx.
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
ctx.stroke();
|
|
830
|
+
if (this.length > 1) {
|
|
831
|
+
var ctx = canvas.getContext('2d');
|
|
832
|
+
if (fillColor) {
|
|
833
|
+
ctx.fillStyle = fillColor;
|
|
834
|
+
}
|
|
835
|
+
if (strokeColor) {
|
|
836
|
+
ctx.strokeStyle = strokeColor;
|
|
837
|
+
}
|
|
838
|
+
if (lineWidth) {
|
|
839
|
+
ctx.lineWidth = lineWidth;
|
|
840
|
+
}
|
|
841
|
+
if (fillColor || strokeColor) {
|
|
842
|
+
ctx.beginPath();
|
|
843
|
+
}
|
|
844
|
+
this.goByPath(ctx, steps % this.length);
|
|
845
|
+
if (shadowColor) {
|
|
846
|
+
ctx.shadowColor = shadowColor;
|
|
847
|
+
ctx.shadowBlur = 0;
|
|
848
|
+
ctx.shadowOffsetX = 1;
|
|
849
|
+
ctx.shadowOffsetY = 1;
|
|
850
|
+
}
|
|
851
|
+
if (fillColor) {
|
|
852
|
+
ctx.closePath();
|
|
853
|
+
ctx.fill();
|
|
854
|
+
}
|
|
855
|
+
if (strokeColor) {
|
|
856
|
+
ctx.stroke();
|
|
857
|
+
}
|
|
859
858
|
}
|
|
859
|
+
return this;
|
|
860
860
|
};
|
|
861
861
|
DPolygon.prototype.clearPolygonOnCanvas = function (canvas) {
|
|
862
862
|
var ctx = canvas.getContext('2d');
|
package/dist/es2015/DPolygon.js
CHANGED
|
@@ -513,36 +513,36 @@ export class DPolygon {
|
|
|
513
513
|
return this.simpleIncludeX(p) && this.simpleIncludeY(p);
|
|
514
514
|
}
|
|
515
515
|
drawPolygonOnCanvas(canvas, fillColor, strokeColor, shadowColor, lineWidth = 1, steps = this.length - 1) {
|
|
516
|
-
if (this.length
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
ctx.
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
ctx.stroke();
|
|
516
|
+
if (this.length > 1) {
|
|
517
|
+
const ctx = canvas.getContext('2d');
|
|
518
|
+
if (fillColor) {
|
|
519
|
+
ctx.fillStyle = fillColor;
|
|
520
|
+
}
|
|
521
|
+
if (strokeColor) {
|
|
522
|
+
ctx.strokeStyle = strokeColor;
|
|
523
|
+
}
|
|
524
|
+
if (lineWidth) {
|
|
525
|
+
ctx.lineWidth = lineWidth;
|
|
526
|
+
}
|
|
527
|
+
if (fillColor || strokeColor) {
|
|
528
|
+
ctx.beginPath();
|
|
529
|
+
}
|
|
530
|
+
this.goByPath(ctx, steps % this.length);
|
|
531
|
+
if (shadowColor) {
|
|
532
|
+
ctx.shadowColor = shadowColor;
|
|
533
|
+
ctx.shadowBlur = 0;
|
|
534
|
+
ctx.shadowOffsetX = 1;
|
|
535
|
+
ctx.shadowOffsetY = 1;
|
|
536
|
+
}
|
|
537
|
+
if (fillColor) {
|
|
538
|
+
ctx.closePath();
|
|
539
|
+
ctx.fill();
|
|
540
|
+
}
|
|
541
|
+
if (strokeColor) {
|
|
542
|
+
ctx.stroke();
|
|
543
|
+
}
|
|
545
544
|
}
|
|
545
|
+
return this;
|
|
546
546
|
}
|
|
547
547
|
clearPolygonOnCanvas(canvas) {
|
|
548
548
|
const ctx = canvas.getContext('2d');
|
package/dist/esm/DPolygon.js
CHANGED
|
@@ -824,36 +824,36 @@ var DPolygon = (function () {
|
|
|
824
824
|
DPolygon.prototype.drawPolygonOnCanvas = function (canvas, fillColor, strokeColor, shadowColor, lineWidth, steps) {
|
|
825
825
|
if (lineWidth === void 0) { lineWidth = 1; }
|
|
826
826
|
if (steps === void 0) { steps = this.length - 1; }
|
|
827
|
-
if (this.length
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
ctx.
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
ctx.stroke();
|
|
827
|
+
if (this.length > 1) {
|
|
828
|
+
var ctx = canvas.getContext('2d');
|
|
829
|
+
if (fillColor) {
|
|
830
|
+
ctx.fillStyle = fillColor;
|
|
831
|
+
}
|
|
832
|
+
if (strokeColor) {
|
|
833
|
+
ctx.strokeStyle = strokeColor;
|
|
834
|
+
}
|
|
835
|
+
if (lineWidth) {
|
|
836
|
+
ctx.lineWidth = lineWidth;
|
|
837
|
+
}
|
|
838
|
+
if (fillColor || strokeColor) {
|
|
839
|
+
ctx.beginPath();
|
|
840
|
+
}
|
|
841
|
+
this.goByPath(ctx, steps % this.length);
|
|
842
|
+
if (shadowColor) {
|
|
843
|
+
ctx.shadowColor = shadowColor;
|
|
844
|
+
ctx.shadowBlur = 0;
|
|
845
|
+
ctx.shadowOffsetX = 1;
|
|
846
|
+
ctx.shadowOffsetY = 1;
|
|
847
|
+
}
|
|
848
|
+
if (fillColor) {
|
|
849
|
+
ctx.closePath();
|
|
850
|
+
ctx.fill();
|
|
851
|
+
}
|
|
852
|
+
if (strokeColor) {
|
|
853
|
+
ctx.stroke();
|
|
854
|
+
}
|
|
856
855
|
}
|
|
856
|
+
return this;
|
|
857
857
|
};
|
|
858
858
|
DPolygon.prototype.clearPolygonOnCanvas = function (canvas) {
|
|
859
859
|
var ctx = canvas.getContext('2d');
|