X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/9a9b045372a6f48420a9a6dacfde52c34ab7abce..282ff4936cc1831fcbe9de0dd2d30c6bccd62b19:/lib/gpx.rb diff --git a/lib/gpx.rb b/lib/gpx.rb index f1c82cf92..3ec11c5c4 100644 --- a/lib/gpx.rb +++ b/lib/gpx.rb @@ -63,7 +63,7 @@ module GPX highlightgc.stroke("#000000") highlightgc.fill("#000000") - images = frames.times.collect do + images = Array(frames) do Magick::Image.new(width, height) do |image| image.background_color = "white" image.format = "GIF" @@ -81,11 +81,11 @@ module GPX if m > 0 frames.times do |n| - if n == mm - gc = highlightgc.dup - else - gc = linegc.dup - end + gc = if n == mm + highlightgc.dup + else + linegc.dup + end gc.line(px, py, oldpx, oldpy) @@ -148,13 +148,11 @@ module GPX end end - private - TrkPt = Struct.new(:segment, :latitude, :longitude, :altitude, :timestamp) do def valid? latitude && longitude && timestamp && - latitude >= -90 && latitude <= 90 && - longitude >= -180 && longitude <= 180 + latitude >= -90 && latitude <= 90 && + longitude >= -180 && longitude <= 180 end end end