polygonfy 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/polygonfy.rb +5 -5
- data/lib/polygonfy/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cbaf6e8383637f2c772bd0d0aba8bc499adae7c1
|
4
|
+
data.tar.gz: 7a04618a3599df193a2b4c6c9b9d8092b0a7dffa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f0b42afbf88f58a2f1007346d874d52147b9c69bf1f6336a96acf0a97ca93aff57bc15dd9295fee1fb70a8c7f42e64a867ffcb47a0bb23702c990915790676b4
|
7
|
+
data.tar.gz: 71fe93ccc90a004b8ea3a017948958432c6f834dfd64efe3a3e164a9afb91409856f25a019516e699c3de3691abc4d24d77be27cf34cdc3cc6b4a2410b73cd44
|
data/lib/polygonfy.rb
CHANGED
@@ -29,12 +29,12 @@ module Polygonfy
|
|
29
29
|
|
30
30
|
points.map! do |p|
|
31
31
|
id, x, y = p.split(',')
|
32
|
-
Point.new(id, x.to_i
|
32
|
+
Point.new(id, x.to_i, y.to_i)
|
33
33
|
end
|
34
34
|
|
35
35
|
xmlns = "http://www.w3.org/2000/svg"
|
36
|
-
width = points.map(&:x).max + MARGIN
|
37
|
-
height = points.map(&:y).max + MARGIN
|
36
|
+
width = points.map(&:x).max + (2 * MARGIN)
|
37
|
+
height = points.map(&:y).max + (2 * MARGIN)
|
38
38
|
|
39
39
|
polygon_points = points.map { |p| "#{p.x},#{p.y}" }.join(' ')
|
40
40
|
|
@@ -43,8 +43,8 @@ module Polygonfy
|
|
43
43
|
xml.polygon(style: STYLES[:polygon], points: polygon_points)
|
44
44
|
xml.g {
|
45
45
|
points.each_with_index do |p, i|
|
46
|
-
xml.circle(style: STYLES[:circle], cx: p.x, cy: p.y, r: "12")
|
47
|
-
xml.text_(x: p.x, y: p.y + 5, 'text-anchor': 'middle') {
|
46
|
+
xml.circle(style: STYLES[:circle], cx: p.x + MARGIN, cy: p.y + MARGIN, r: "12")
|
47
|
+
xml.text_(x: p.x + MARGIN, y: p.y + 5 + MARGIN, 'text-anchor': 'middle') {
|
48
48
|
xml.text(p.id)
|
49
49
|
xml.title {
|
50
50
|
xml.text(point_title(points, i))
|
data/lib/polygonfy/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: polygonfy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexandre Magro
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-05-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|