astromapper 1.0.13 → 1.0.14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/astromapper/svg.rb +10 -11
- data/lib/astromapper/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bd37e769365972cf1d07c0646232ef187dcb772d
|
4
|
+
data.tar.gz: c278e01a9760d72532061854f09e15ce63896865
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 66bb649697262d03492747f9666d869f24bf351bfdb8054630013769a351d70a66563b003ac20cc2b2342a889ae2f1e6c37abbe0ee7e2e050aa4496c9e3ca197
|
7
|
+
data.tar.gz: 04fdf6754e9d6eba6fa1d42f5863ece660300b5f56896cb628a45e97bf0c08d63136e28b64d1b440bfc3ca5061c21e9d19e463ed3ea4914b713eece44a498f8c
|
data/lib/astromapper/svg.rb
CHANGED
@@ -92,7 +92,6 @@ module Astromapper
|
|
92
92
|
}
|
93
93
|
g.gas-giant ellipse {
|
94
94
|
fill: #034;
|
95
|
-
fill: none;
|
96
95
|
stroke-width: 1;
|
97
96
|
}
|
98
97
|
circle {
|
@@ -233,7 +232,7 @@ module Astromapper
|
|
233
232
|
output += "</g>"
|
234
233
|
end
|
235
234
|
def polygon(x, y, sx, sy, sides=4)
|
236
|
-
polygon = star_coords(sx, sy, sides).map { |c| "#{x + c[0]},#{y.tweak+c[1]}" }
|
235
|
+
polygon = star_coords(sx, sy, sides).map { |c| "#{(x + c[0]).to_i},#{(y.tweak+c[1]).to_i}" }
|
237
236
|
" <polygon points='#{polygon.join(' ')}' />\n"
|
238
237
|
end
|
239
238
|
def gas_giant(c)
|
@@ -246,13 +245,13 @@ module Astromapper
|
|
246
245
|
GIANT
|
247
246
|
end
|
248
247
|
def pirates(c);
|
249
|
-
return "<!-- Pirates --><text class='symbol' x='#{c[0]-(@side/3.1)}' y='#{c[1]+(@side/7)}'>\u2620</text>\n"
|
248
|
+
return "<!-- Pirates --><text class='symbol' x='#{(c[0]-(@side/3.1)).to_i}' y='#{(c[1]+(@side/7)).to_i}'>\u2620</text>\n"
|
250
249
|
end
|
251
250
|
def consulate(c);
|
252
|
-
return "<!-- Consulate --><text class='symbol' x='#{c[0]-(@side/1.5)}' y='#{c[1]+(@side/7)}'>\u2691</text>\n"
|
251
|
+
return "<!-- Consulate --><text class='symbol' x='#{(c[0]-(@side/1.5)).to_i}' y='#{(c[1]+(@side/7)).to_i}'>\u2691</text>\n"
|
253
252
|
end
|
254
253
|
def scout_base(c);
|
255
|
-
return "<!-- Scout Base --><text class='symbol' x='#{c[0]-(@side/1.8)}' y='#{c[1]+(@side/2.4)}'>\u269C</text>\n"
|
254
|
+
return "<!-- Scout Base --><text class='symbol' x='#{(c[0]-(@side/1.8)).to_i}' y='#{(c[1]+(@side/2.4)).to_i}'>\u269C</text>\n"
|
256
255
|
'<!-- SB -->' + polygon(c[0]-(@side/1.8),c[1]+(@side/3.7), @side/(@mark/2), @side/@mark, 3);
|
257
256
|
end
|
258
257
|
def navy_base(c);
|
@@ -271,25 +270,25 @@ module Astromapper
|
|
271
270
|
(@columns/2).ceil.times do |j|
|
272
271
|
x = j * @side * 3
|
273
272
|
y = ly
|
274
|
-
points << "#{x.tweak},#{y.tweak}"
|
273
|
+
points << "#{x.tweak.to_i},#{y.tweak.to_i}"
|
275
274
|
|
276
275
|
x += @hex[:side_w]
|
277
276
|
y = (top) ? y - @hex[:side_h] : y + @hex[:side_h]
|
278
|
-
points << "#{x.tweak},#{y.tweak}"
|
277
|
+
points << "#{x.tweak.to_i},#{y.tweak.to_i}"
|
279
278
|
|
280
279
|
x += @hex[:width]
|
281
|
-
points << "#{x.tweak},#{y.tweak}"
|
280
|
+
points << "#{x.tweak.to_i},#{y.tweak.to_i}"
|
282
281
|
|
283
282
|
x += @hex[:side_w]
|
284
283
|
y = (top) ? y + @hex[:side_h] : y - @hex[:side_h]
|
285
|
-
points << "#{x.tweak},#{y.tweak}"
|
284
|
+
points << "#{x.tweak.to_i},#{y.tweak.to_i}"
|
286
285
|
|
287
286
|
x += @hex[:width]
|
288
|
-
points << "#{x.tweak},#{y.tweak}"
|
287
|
+
points << "#{x.tweak.to_i},#{y.tweak.to_i}"
|
289
288
|
end
|
290
289
|
x += @hex[:side_w]
|
291
290
|
y = (top) ? y - @hex[:side_h] : y + @hex[:side_h]
|
292
|
-
points << "#{x.tweak},#{y.tweak}"
|
291
|
+
points << "#{x.tweak.to_i},#{y.tweak.to_i}"
|
293
292
|
" <polyline points='#{points.join(' ')}' />"
|
294
293
|
end
|
295
294
|
end
|
data/lib/astromapper/version.rb
CHANGED