Skip to content

Commit 2f8c006

Browse files
committed
added stepRate check for GetPoints methods
1 parent 88b088b commit 2f8c006

6 files changed

Lines changed: 6 additions & 6 deletions

File tree

src/geom/circle/GetPoints.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ var GetPoints = function (circle, quantity, stepRate, out)
2828
if (out === undefined) { out = []; }
2929

3030
// If quantity is a falsey value (false, null, 0, undefined, etc) then we calculate it based on the stepRate instead.
31-
if (!quantity)
31+
if (!quantity && stepRate > 0)
3232
{
3333
quantity = Circumference(circle) / stepRate;
3434
}

src/geom/ellipse/GetPoints.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ var GetPoints = function (ellipse, quantity, stepRate, out)
3030
if (out === undefined) { out = []; }
3131

3232
// If quantity is a falsey value (false, null, 0, undefined, etc) then we calculate it based on the stepRate instead.
33-
if (!quantity)
33+
if (!quantity && stepRate > 0)
3434
{
3535
quantity = Circumference(ellipse) / stepRate;
3636
}

src/geom/line/GetPoints.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ var GetPoints = function (line, quantity, stepRate, out)
3232
if (out === undefined) { out = []; }
3333

3434
// If quantity is a falsey value (false, null, 0, undefined, etc) then we calculate it based on the stepRate instead.
35-
if (!quantity)
35+
if (!quantity && stepRate > 0)
3636
{
3737
quantity = Length(line) / stepRate;
3838
}

src/geom/polygon/GetPoints.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ var GetPoints = function (polygon, quantity, stepRate, out)
3030
var perimeter = Perimeter(polygon);
3131

3232
// If quantity is a falsey value (false, null, 0, undefined, etc) then we calculate it based on the stepRate instead.
33-
if (!quantity)
33+
if (!quantity && stepRate > 0)
3434
{
3535
quantity = perimeter / stepRate;
3636
}

src/geom/rectangle/GetPoints.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ var GetPoints = function (rectangle, quantity, stepRate, out)
3030
if (out === undefined) { out = []; }
3131

3232
// If quantity is a falsey value (false, null, 0, undefined, etc) then we calculate it based on the stepRate instead.
33-
if (!quantity)
33+
if (!quantity && stepRate > 0)
3434
{
3535
quantity = Perimeter(rectangle) / stepRate;
3636
}

src/geom/triangle/GetPoints.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ var GetPoints = function (triangle, quantity, stepRate, out)
3737
var perimeter = length1 + length2 + length3;
3838

3939
// If quantity is a falsey value (false, null, 0, undefined, etc) then we calculate it based on the stepRate instead.
40-
if (!quantity)
40+
if (!quantity && stepRate > 0)
4141
{
4242
quantity = perimeter / stepRate;
4343
}

0 commit comments

Comments
 (0)