astromapper 1.0.9 → 1.0.10
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 +8 -9
- 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: d42ddb86d452bccf252df72a4e3419eabbda1e04
|
4
|
+
data.tar.gz: 7b9005d55094f0501748524d13bfb735527f133f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6ce4be5b6326a7109a2025b9d8ab3d8f2ccd319d31fcfd545c65a08ae25d780bffdbc4335b5838c6984f14cb1c0d59ea80724764378f94b2afc6cbda28ab5e33
|
7
|
+
data.tar.gz: 8ded5a1c91c8cd2bc5347686f688bfc4b3ad0557d33c67718a9cd5b3d3b9eeff55de53495b7b838264c00567cc2e58612536b98c2719bc371e2cd96709dbc1af
|
data/lib/astromapper/svg.rb
CHANGED
@@ -56,7 +56,6 @@ module Astromapper
|
|
56
56
|
svg {
|
57
57
|
fill: #FFF;
|
58
58
|
}
|
59
|
-
file: #FFF;
|
60
59
|
text {
|
61
60
|
text-anchor: middle;
|
62
61
|
fill: #567;
|
@@ -152,11 +151,11 @@ module Astromapper
|
|
152
151
|
output = "<!-- Volume: #{volume.strip.gsub(/\t/,' // ')} -->\n"
|
153
152
|
output += (size == '0') ? draw_belt(c) : draw_planet(c,uwp)
|
154
153
|
output += " <text class='spaceport' x='#{c[0]}' y='#{(c[1] + @side / 2).tweak}'>#{spaceport.strip}</text>\n"
|
155
|
-
output += " <text x='#{c[0]}' y='#{(c[1]+(@side/1.3)).tweak}'>#{uwp.strip}</text>\n"
|
156
|
-
output += " <text x='#{c[0]}' y='#{(c[1]-(@side/2.1)).tweak}'>#{name.strip}</text>\n"
|
154
|
+
output += " <text x='#{c[0].to_i}' y='#{(c[1]+(@side/1.3)).tweak}'>#{uwp.strip}</text>\n"
|
155
|
+
output += " <text x='#{c[0].to_i}' y='#{(c[1]-(@side/2.1)).tweak}'>#{name.strip}</text>\n"
|
157
156
|
unless zone == '..'
|
158
157
|
style = zone + '_zone'
|
159
|
-
output += " <path d='M #{c[0] - curve/2
|
158
|
+
output += " <path d='M #{(c[0] - curve/2).to_i} #{(c[1] - (curve/1.4)).to_i} a #{curve} #{curve} 0 1 0 20 0' />\n"
|
160
159
|
end
|
161
160
|
output += navy_base(c) if nsg.include?('N')
|
162
161
|
output += scout_base(c) if nsg.include?('S')
|
@@ -173,7 +172,7 @@ module Astromapper
|
|
173
172
|
x = (c[0]+(@side/1.8)).tweak + 2
|
174
173
|
y = (c[1]-(@side/3)).tweak + 3
|
175
174
|
stars.split('/').each do |star|
|
176
|
-
output += " <text x='#{x}' y='#{y}'>#{star[0..1].strip}</text>\n"
|
175
|
+
output += " <text x='#{x.to_i}' y='#{y.to_i}'>#{star[0..1].strip}</text>\n"
|
177
176
|
x += 3
|
178
177
|
y += 7
|
179
178
|
end
|
@@ -181,14 +180,14 @@ module Astromapper
|
|
181
180
|
end
|
182
181
|
def draw_planet(c,w)
|
183
182
|
k = (w[3] == '0') ? 'Desert' : 'Planet'
|
184
|
-
" <circle class='planet' cx='#{c[0]}' cy='#{c[1]}' r='#{@side/7}' />\n"
|
183
|
+
" <circle class='planet' cx='#{c[0].to_i}' cy='#{c[1].to_i}' r='#{(@side/7).to_i}' />\n"
|
185
184
|
end
|
186
185
|
def draw_belt(c)
|
187
|
-
output = " <g
|
186
|
+
output = " <g class='belt'>\n"
|
188
187
|
7.times do
|
189
188
|
x = c[0] + Random.rand(@side/3) - @side/6
|
190
189
|
y = c[1] + Random.rand(@side/3) - @side/6
|
191
|
-
output += " <circle class='belt' cx='#{x.tweak}' cy='#{y.tweak}' r='#{(@side/15).tweak}' />\n"
|
190
|
+
output += " <circle class='belt' cx='#{x.tweak.to_i}' cy='#{y.tweak.to_i}' r='#{(@side/15).tweak}' />\n"
|
192
191
|
end
|
193
192
|
output + " </g>\n"
|
194
193
|
end
|
@@ -223,7 +222,7 @@ module Astromapper
|
|
223
222
|
(@columns+1).times do |c|
|
224
223
|
x = @side + ((c-1) * @side * 1.5)
|
225
224
|
y = (c % 2 == 1) ? (r-1) * @side * @factor + (0.2 * @side) : (r-1) * @side * @factor + @hex[:side_h]+ (0.2 * @side)
|
226
|
-
output += "<text x='#{x.tweak}' y='#{y.tweak}'>%02d%02d</text>\n" % [c,r]
|
225
|
+
output += "<text x='#{x.tweak.to_i}' y='#{y.tweak.to_i}'>%02d%02d</text>\n" % [c,r]
|
227
226
|
end
|
228
227
|
end
|
229
228
|
output += "</g>"
|
data/lib/astromapper/version.rb
CHANGED