astromapper 1.0.11 → 1.0.12
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 -5
- 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: e5191dbe554ddbb6f9e80e9842d669eb2efbdc31
|
4
|
+
data.tar.gz: 77e42b3fb2f58971ca6fbfe300a4b0e2b3f4985a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 45fee73c945cc28e7d00936fb807daed472be4bbf3b8524f560afe4de165cf801460aeb9502bc172499ebfc41e163a7938f7834d98646705f0b097de1fa24ddb
|
7
|
+
data.tar.gz: 6962658215788b4c0ae11133e971319d3524b40f5db7af1c01a082fedb91d98c62f41a3b7f6d39fd119a5fe03a4fde811d217d25e45cc66f6e26b1eb2963445d
|
data/lib/astromapper/svg.rb
CHANGED
@@ -100,6 +100,11 @@ module Astromapper
|
|
100
100
|
stroke: #fff;
|
101
101
|
stroke-width: 1;
|
102
102
|
}
|
103
|
+
circle.belt {
|
104
|
+
stroke: #222;
|
105
|
+
belt: #fff;
|
106
|
+
stroke-width: 1;
|
107
|
+
}
|
103
108
|
.lowsec {
|
104
109
|
fill: none;
|
105
110
|
stroke: #B90;
|
@@ -193,7 +198,7 @@ module Astromapper
|
|
193
198
|
end
|
194
199
|
def frame(k='Frame')
|
195
200
|
style = k.to_sym
|
196
|
-
z = 0; w = @width - 0; h = @height - z;
|
201
|
+
z = 0; w = @width.to_i - 0; h = @height.to_i - z;
|
197
202
|
" <polyline class='frame' points='#{z},#{z} #{w},#{z} #{w},#{h} #{z},#{h} #{z},#{z}' />"
|
198
203
|
end
|
199
204
|
def tract_marks
|
@@ -204,10 +209,10 @@ module Astromapper
|
|
204
209
|
output = ''
|
205
210
|
letters = ('A'..'P').to_a
|
206
211
|
5.times do |r|
|
207
|
-
h1 = (height.floor * r) - (8*r); h2 = h1 + height - 8
|
212
|
+
h1 = ((height.floor * r) - (8*r); h2 = h1 + height - 8).to_i
|
208
213
|
w2 = 0
|
209
214
|
4.times do |c|
|
210
|
-
w1 = w2; w2 += (width - [-4,4,5,-4][c])
|
215
|
+
w1 = w2.to_i; w2 += (width - [-4,4,5,-4][c]).to_i
|
211
216
|
output += " <text class='tract' x='#{w1 + 70}' y='#{h1 + 110}'>#{letters.shift}</text>\n"
|
212
217
|
output += " <polyline class='tract' points='#{w1},#{h1} #{w2},#{h1} #{w2},#{h2} #{w1},#{h2} #{w1},#{h1}' />\n"
|
213
218
|
# raise output
|
@@ -235,8 +240,8 @@ module Astromapper
|
|
235
240
|
x = (c[0]+(@side/1.8)).tweak; y = (c[1]+(@side/3)).tweak;
|
236
241
|
return<<-GIANT
|
237
242
|
<g class='gas-giant'><!-- Has Gas Giant -->
|
238
|
-
<ellipse cx='#{x}' cy='#{y}' rx='#{(@side/(@mark * 0.5)).tweak}' ry='#{(@side/@mark * 0.3).tweak}' />
|
239
|
-
<circle cx='#{x}' cy='#{y}' r='#{(@side/(@mark * 1.2)).tweak}' />
|
243
|
+
<ellipse cx='#{x.to_i}' cy='#{y.to_i}' rx='#{(@side/(@mark * 0.5)).tweak.to_i}' ry='#{(@side/@mark * 0.3).tweak.to_i}' />
|
244
|
+
<circle cx='#{x.to_i}' cy='#{y.to_i}' r='#{(@side/(@mark * 1.2)).tweak.to_i}' />
|
240
245
|
</g>
|
241
246
|
GIANT
|
242
247
|
end
|
data/lib/astromapper/version.rb
CHANGED