Round up the frame size for trace animations
authorTom Hughes <tom@compton.nu>
Tue, 11 Jun 2019 21:33:07 +0000 (22:33 +0100)
committerTom Hughes <tom@compton.nu>
Tue, 11 Jun 2019 21:33:07 +0000 (22:33 +0100)
lib/gpx.rb

index cfc82ee..0aa23ae 100644 (file)
@@ -66,7 +66,7 @@ module GPX
       height = 250
       delay = 50
 
-      points_per_frame = num_points / nframes
+      points_per_frame = (num_points.to_f / nframes).ceil
 
       proj = OSM::Mercator.new(min_lat, min_lon, max_lat, max_lon, width, height)