X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/037585db3933a2954b43bd4b30ea5e30ade00be2..44d4a521a3c44d86d251f1f63c7232e61160e30a:/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