astromapper 1.0.16 → 1.0.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/astromapper/svg.rb +13 -14
- 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: d59029e7dc0af82a8f9bc2de1f6d8bfc3cc9581f
|
4
|
+
data.tar.gz: bbe700f756bda5b01e4ee89097a745a81dc65a0a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5c9aa9d3b18dc94fb7071c9af2cd434b9728ff588385d47f64e3eb3017157df5c96b2632af36a3fc8f216bc89139300177c503d4489eb5e397cff0b82054660c
|
7
|
+
data.tar.gz: d968fe1bc04346c108e73d35591278156eb37e92a1edc25e10bbf04febc3b4bc32b6b95a9260438b6bb00e28559594d3ddacd259882ef41435262c175c1b8fd4
|
data/lib/astromapper/svg.rb
CHANGED
@@ -149,9 +149,9 @@ module Astromapper
|
|
149
149
|
|
150
150
|
output = "<!-- Volume: #{volume.strip.gsub(/\t/,' // ')} -->\n"
|
151
151
|
output += (size == '0') ? draw_belt(c) : draw_planet(c,uwp)
|
152
|
-
output += " <text class='spaceport' x='#{c[0].to_i}' y='#{(c[1] + @side / 2).
|
153
|
-
output += " <text x='#{c[0].to_i}' y='#{(c[1]+(@side/1.3)).
|
154
|
-
output += " <text x='#{c[0].to_i}' y='#{(c[1]-(@side/2.1)).
|
152
|
+
output += " <text class='spaceport' x='#{c[0].to_i}' y='#{(c[1] + @side / 2).to_i}'>#{spaceport.strip}</text>\n"
|
153
|
+
output += " <text x='#{c[0].to_i}' y='#{(c[1]+(@side/1.3)).to_i}'>#{uwp.strip}</text>\n"
|
154
|
+
output += " <text x='#{c[0].to_i}' y='#{(c[1]-(@side/2.1)).to_i}'>#{name.strip}</text>\n"
|
155
155
|
unless zone == '..'
|
156
156
|
style = zone + '_zone'
|
157
157
|
output += " <path class='zone' d='M #{(c[0] - curve/2).to_i} #{(c[1] - (curve/1.4)).to_i} a #{curve} #{curve} 0 1 0 20 0' />\n"
|
@@ -161,7 +161,6 @@ module Astromapper
|
|
161
161
|
output += gas_giant(c) if nsg.include?('G')
|
162
162
|
output += consulate(c) if nsg.include?('C')
|
163
163
|
output += pirates(c) if nsg.include?('P')
|
164
|
-
# output += " <text #{@style[:Name]} x='#{(c[0]+(@side/1.8)).tweak}' y='#{(c[1]-(@side/3)).tweak}'>#{star[0..1].strip}</text>\n"
|
165
164
|
output += stars(c,star)
|
166
165
|
output
|
167
166
|
|
@@ -186,7 +185,7 @@ module Astromapper
|
|
186
185
|
7.times do
|
187
186
|
x = c[0] + Random.rand(@side/3) - @side/6
|
188
187
|
y = c[1] + Random.rand(@side/3) - @side/6
|
189
|
-
output += " <circle class='belt' cx='#{x.
|
188
|
+
output += " <circle class='belt' cx='#{x.to_i}' cy='#{y.to_i}' r='#{(@side/15).tweak}' />\n"
|
190
189
|
end
|
191
190
|
output + " </g>\n"
|
192
191
|
end
|
@@ -221,7 +220,7 @@ module Astromapper
|
|
221
220
|
(@columns+1).times do |c|
|
222
221
|
x = @side + ((c-1) * @side * 1.5)
|
223
222
|
y = (c % 2 == 1) ? (r-1) * @side * @factor + (0.2 * @side) : (r-1) * @side * @factor + @hex[:side_h]+ (0.2 * @side)
|
224
|
-
output += "<text x='#{x.
|
223
|
+
output += "<text x='#{x.to_i}' y='#{y.to_i}'>%02d%02d</text>\n" % [c,r]
|
225
224
|
end
|
226
225
|
end
|
227
226
|
output += "</g>"
|
@@ -234,8 +233,8 @@ module Astromapper
|
|
234
233
|
x = (c[0]+(@side/1.8)).tweak; y = (c[1]+(@side/3)).tweak;
|
235
234
|
return<<-GIANT
|
236
235
|
<g class='gas-giant'><!-- Has Gas Giant -->
|
237
|
-
<ellipse cx='#{x.to_i}' cy='#{y.to_i}' rx='#{(@side/(@mark * 0.5)).
|
238
|
-
<circle cx='#{x.to_i}' cy='#{y.to_i}' r='#{(@side/(@mark * 1.2)).
|
236
|
+
<ellipse cx='#{x.to_i}' cy='#{y.to_i}' rx='#{(@side/(@mark * 0.5)).to_i}' ry='#{(@side/@mark * 0.3).tweak}' />
|
237
|
+
<circle cx='#{x.to_i}' cy='#{y.to_i}' r='#{(@side/(@mark * 1.2)).to_i}' />
|
239
238
|
</g>
|
240
239
|
GIANT
|
241
240
|
end
|
@@ -265,25 +264,25 @@ module Astromapper
|
|
265
264
|
(@columns/2).ceil.times do |j|
|
266
265
|
x = j * @side * 3
|
267
266
|
y = ly
|
268
|
-
points << "#{x.
|
267
|
+
points << "#{x.to_i},#{y.to_i}"
|
269
268
|
|
270
269
|
x += @hex[:side_w]
|
271
270
|
y = (top) ? y - @hex[:side_h] : y + @hex[:side_h]
|
272
|
-
points << "#{x.
|
271
|
+
points << "#{x.to_i},#{y.to_i}"
|
273
272
|
|
274
273
|
x += @hex[:width]
|
275
|
-
points << "#{x.
|
274
|
+
points << "#{x.to_i},#{y.to_i}"
|
276
275
|
|
277
276
|
x += @hex[:side_w]
|
278
277
|
y = (top) ? y + @hex[:side_h] : y - @hex[:side_h]
|
279
|
-
points << "#{x.
|
278
|
+
points << "#{x.to_i},#{y.to_i}"
|
280
279
|
|
281
280
|
x += @hex[:width]
|
282
|
-
points << "#{x.
|
281
|
+
points << "#{x.to_i},#{y.to_i}"
|
283
282
|
end
|
284
283
|
x += @hex[:side_w]
|
285
284
|
y = (top) ? y - @hex[:side_h] : y + @hex[:side_h]
|
286
|
-
points << "#{x.
|
285
|
+
points << "#{x.to_i},#{y.to_i}"
|
287
286
|
" <polyline points='#{points.join(' ')}' />"
|
288
287
|
end
|
289
288
|
end
|
data/lib/astromapper/version.rb
CHANGED