astromapper 1.0.48 → 1.0.49
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 +14 -10
- 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: 2cef6ee3f34623291decb3188c009453944ad0b0
|
4
|
+
data.tar.gz: af29463fc33648f38a2236a98b294cfd74aaa6e2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b02969a7b2a4745b1a06497a2c4268e8cf503f4e1b7a4a2431fa45f4841ea1772082c26f052685a1f23a1320e0347790531502b1118a6eb87b113b42c51c1e89
|
7
|
+
data.tar.gz: 8c3231768d4ec568ff330f35cb532dfc53d4195aa9e504d6f12bd405db61118726369a727ff3d26e23e343018e3bad2e578744d9328aec1ece744ee79374ef3f
|
data/lib/astromapper/svg.rb
CHANGED
@@ -16,7 +16,8 @@ module Astromapper
|
|
16
16
|
@mark = 13
|
17
17
|
@zones = []
|
18
18
|
@volumes = []
|
19
|
-
@routes = {}
|
19
|
+
# @routes = {}
|
20
|
+
@routes = []
|
20
21
|
@name = config['name']
|
21
22
|
|
22
23
|
@hex = {
|
@@ -36,22 +37,25 @@ module Astromapper
|
|
36
37
|
keys.each do |k|
|
37
38
|
x = k[0..1].to_i
|
38
39
|
y = k[2..3].to_i
|
39
|
-
# @routes[k] = []
|
40
|
+
# @routes[k] = [] if @routes[k].nil?
|
40
41
|
(-4..4).to_a.each do |n|
|
41
42
|
(-4..4).to_a.each do |m|
|
42
|
-
|
43
43
|
x1 = (x + m)
|
44
44
|
y1 = (y + n)
|
45
|
+
d = Math.sqrt((x - x1)**2 + (y - y1)**2).floor
|
45
46
|
next if y1 > 40
|
46
47
|
next if x1 > 32
|
47
|
-
d = Math.sqrt((x - x1)**2 + (y - y1)**2).floor
|
48
|
-
c = "%02d%02d" % [x1, y1]
|
49
48
|
next if d == 0
|
50
|
-
|
51
|
-
#
|
52
|
-
|
53
|
-
|
54
|
-
|
49
|
+
c = "%02d%02d" % [x1, y1]
|
50
|
+
# if (keys.include?(c) and !@routes[c].include?(k))
|
51
|
+
if (keys.include?(c) and !@routes.include?("#{k}#{c}"))
|
52
|
+
a = center_of(k)
|
53
|
+
b = center_of(c)
|
54
|
+
routes << "<!-- #{k} > #{c} --><line class='line#{d}' x1='#{a[0]}' y1='#{a[1]}' x2='#{b[0]}' y2='#{b[1]}' />"
|
55
|
+
# @routes[k] << c
|
56
|
+
# @routes[c] = [k] if @routes[c].nil?
|
57
|
+
@routes << "#{c}#{k}" # reverse look-up.
|
58
|
+
end
|
55
59
|
end
|
56
60
|
end
|
57
61
|
end
|
data/lib/astromapper/version.rb
CHANGED