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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 75415e890dff458963065f8d99b0a6087ec1259e
4
- data.tar.gz: 1bb8b14cbf46db3519c5a49f3d8cdf768c732e59
3
+ metadata.gz: cbaf6e8383637f2c772bd0d0aba8bc499adae7c1
4
+ data.tar.gz: 7a04618a3599df193a2b4c6c9b9d8092b0a7dffa
5
5
  SHA512:
6
- metadata.gz: 81f235e862dc9685e844e495a7ccd08e9b6b643596512aeb703a867b39c89e528082d99eac48a8c44b21d9a02c7ba5455524376e2c0dcb7877626730d5f3dad4
7
- data.tar.gz: ac99be018e02e715bfc209f26a59a981de24c1b1e0f5700ca618be7c69ddcb76d32494210befd06ff8df653a575b2a78f5efae3a4c62aca7a6aca41f454ebc61
6
+ metadata.gz: f0b42afbf88f58a2f1007346d874d52147b9c69bf1f6336a96acf0a97ca93aff57bc15dd9295fee1fb70a8c7f42e64a867ffcb47a0bb23702c990915790676b4
7
+ data.tar.gz: 71fe93ccc90a004b8ea3a017948958432c6f834dfd64efe3a3e164a9afb91409856f25a019516e699c3de3691abc4d24d77be27cf34cdc3cc6b4a2410b73cd44
@@ -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 + MARGIN, y.to_i + MARGIN)
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))
@@ -1,3 +1,3 @@
1
1
  module Polygonfy
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
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.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-04-22 00:00:00.000000000 Z
11
+ date: 2017-05-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri