Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/main/java/ij3d/shapes/BoundingBox.java
Original file line number Diff line number Diff line change
Expand Up @@ -198,12 +198,18 @@ private Appearance createAppearance(final Color3f color) {

private Geometry makeLine(final Point3f start, final Point3f end,
final Color3f color, final float tickDistance, final float first,
final float tickSize, final boolean noTicks)
final float tickSize, boolean noTicks)
{
final float lineLength = start.distance(end);
final int nTicks =
(int) Math.floor((lineLength - first) / tickDistance) + 1;

// Avoid negative array size. This occurs when the (lineLength - first)
// is negative.
if (nTicks < 1) {
noTicks = true;
}

final int n = noTicks ? 2 : nTicks * 6 + 2;

final Point3f[] coords = new Point3f[n];
Expand Down