JAL-2349 avoid div-by-zero when annotation height is zero (though poss better to...
[jalview.git] / src / jalview / renderer / ContactGeometry.java
index 0e5107a..52581fb 100644 (file)
@@ -16,7 +16,8 @@ public class ContactGeometry
   {
     contact_height = contacts.getContactHeight();
     // fractional number of contacts covering each pixel
-    contacts_per_pixel = ((double) contact_height) / ((double) graphHeight);
+    contacts_per_pixel = (graphHeight < 1) ? contact_height
+            : ((double) contact_height) / ((double) graphHeight);
 
     if (contacts_per_pixel >= 1)
     {