summaryrefslogtreecommitdiff
path: root/graphics/asymptote/base/graph.asy
diff options
context:
space:
mode:
Diffstat (limited to 'graphics/asymptote/base/graph.asy')
-rw-r--r--graphics/asymptote/base/graph.asy8
1 files changed, 7 insertions, 1 deletions
diff --git a/graphics/asymptote/base/graph.asy b/graphics/asymptote/base/graph.asy
index 18821b456d..433aa2fc20 100644
--- a/graphics/asymptote/base/graph.asy
+++ b/graphics/asymptote/base/graph.asy
@@ -2213,7 +2213,13 @@ picture vectorfield(path vector(pair), pair a, pair b,
max=maxbound(max,size((x,y)));
}
}
- scale=min(dx/max.x,dy/max.y);
+
+ if(max.x == 0)
+ scale=max.y == 0 ? 1.0 : dy/max.y;
+ else if(max.y == 0)
+ scale=dx/max.x;
+ else
+ scale=min(dx/max.x,dy/max.y);
for(int i=0; i < nx; ++i) {
real x=a.x+i*dx;