JAL-2349 avoid div-by-zero when annotation height is zero (though poss better to...
authorJim Procter <j.procter@dundee.ac.uk>
Thu, 20 Oct 2022 15:45:16 +0000 (16:45 +0100)
committerJim Procter <j.procter@dundee.ac.uk>
Thu, 20 Oct 2022 15:45:16 +0000 (16:45 +0100)
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)
     {