r2dsvg 0.4.1 → 0.4.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (6) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +0 -0
  3. data.tar.gz.sig +0 -0
  4. data/lib/r2dsvg.rb +41 -6
  5. metadata +12 -12
  6. metadata.gz.sig +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2b561aa931c1a66e2884576dea1525f9f3c77cb07b5757fb11081b8f807aaf91
4
- data.tar.gz: 45a8bd9cca6d36ffb694c8c1337849ebfe4819fb0f06493799131a171a168a95
3
+ metadata.gz: 4baad19f18ea64cd7a6272315012accb4f6784fd9efaef58c53a1534c289f011
4
+ data.tar.gz: 2406a7502a56f6d9a2a50851c29475e28d003fa7eef1206504f8ab328c1365a1
5
5
  SHA512:
6
- metadata.gz: a117efd8624e7b97c7b35dc84fa10f4ed683841c86377c13c81c7c41fb8bc262d47ec178445333f173e6dade0a6d54ddbd7eb83f3743bc9129536166df76f5f2
7
- data.tar.gz: cdb7a48f18fe178376f3b4331a969e1793d62863bc15bd6c1ce7cd47e9bba31fde0dfee99eec927284859066f88cb9aa69661e3c102a549ea242723a6a711a42
6
+ metadata.gz: 44b0861936c7abf63a1868fcae7a30c2812c04098b65e0b1d2c1b755d1420665de401a0de1ada1edf8e52d88ff33677b79dd81c6894b5a848375caeae423cb90
7
+ data.tar.gz: 8159d327f5331ee4adb6b5d9c2228bf20786f701b6ae8a3f86497f1d0b7b6b425cb787d49b74ad0d892ce06d52a2c4ac0563f71acf25c1eaad8be0c1a0948672
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -20,6 +20,28 @@ text {fill: red, size: 20}
20
20
 
21
21
  CSS
22
22
 
23
+ class Svgle
24
+
25
+ class Shape
26
+
27
+ def initialize(*args)
28
+ super(*args)
29
+ @attr_map ||= {fill: :color}
30
+ end
31
+
32
+ def attr_update(name, val)
33
+
34
+ puts 'inside attr_update, @attr_map: ' + @attr_map.inspect if @debug
35
+ name = (@attr_map[name].to_s + '=').to_sym
36
+ @obj.method(name).call(val) if @obj.respond_to? name
37
+
38
+ end
39
+ end
40
+
41
+ end
42
+
43
+
44
+
23
45
  module SvgleX
24
46
 
25
47
  refine Svgle::Element do
@@ -31,8 +53,9 @@ module SvgleX
31
53
  def obj()
32
54
  @obj
33
55
  end
34
-
56
+
35
57
  end
58
+
36
59
 
37
60
  refine Svgle::Text do
38
61
 
@@ -50,6 +73,9 @@ module SvgleX
50
73
 
51
74
  end
52
75
 
76
+
77
+
78
+
53
79
  class R2dSvg
54
80
  include Ruby2D
55
81
  using ColouredText
@@ -150,9 +176,7 @@ class R2dSvg
150
176
  [:draw_rectangle, [x1, y1, x2, y2], style, e, render_all(e)]
151
177
  end
152
178
 
153
- def script(e, attributes, style)
154
- [:script]
155
- end
179
+
156
180
 
157
181
  def svg(e, attributes, raw_style)
158
182
 
@@ -411,6 +435,9 @@ class R2dSvg
411
435
  def script(args)
412
436
 
413
437
  end
438
+
439
+ def style(args)
440
+ end
414
441
 
415
442
  private
416
443
 
@@ -516,16 +543,24 @@ class R2dSvg
516
543
  @width, @height = %i(width height).map{|x| doc.root.attributes[x].to_i }
517
544
  @window.set title: title, width: @width, height: @height
518
545
 
519
- Thread.new do
546
+ threads = []
547
+
548
+ threads << Thread.new do
520
549
  doc.root.xpath('//script').each {|x| eval x.text.unescape }
521
550
  drawing.render instructions
522
551
  end
552
+
553
+ threads.join
523
554
 
524
555
  @loaded = true
525
556
  @doc = doc
526
557
 
527
558
  end
528
559
 
560
+ def refresh()
561
+ puts 'do nothing' if @debug
562
+ end
563
+
529
564
 
530
565
  private
531
566
 
@@ -548,7 +583,7 @@ class R2dSvg
548
583
 
549
584
  end
550
585
 
551
- @doc.event[action].each {|name| method(name).call event.key }
586
+ @doc.event[action].each {|name| method(name).call event }
552
587
 
553
588
  end
554
589
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: r2dsvg
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -35,7 +35,7 @@ cert_chain:
35
35
  2z9cm0kGX/0pBfn8cMKC0JgNNNONx3uqiCAhaBEN35C8dqBjua/CK4rMoKEB7XQq
36
36
  OAk+mR2SqyWecmZhdnsnm86T
37
37
  -----END CERTIFICATE-----
38
- date: 2020-04-30 00:00:00.000000000 Z
38
+ date: 2020-05-12 00:00:00.000000000 Z
39
39
  dependencies:
40
40
  - !ruby/object:Gem::Dependency
41
41
  name: svgle
@@ -46,7 +46,7 @@ dependencies:
46
46
  version: '0.4'
47
47
  - - ">="
48
48
  - !ruby/object:Gem::Version
49
- version: 0.4.5
49
+ version: 0.4.6
50
50
  type: :runtime
51
51
  prerelease: false
52
52
  version_requirements: !ruby/object:Gem::Requirement
@@ -56,7 +56,7 @@ dependencies:
56
56
  version: '0.4'
57
57
  - - ">="
58
58
  - !ruby/object:Gem::Version
59
- version: 0.4.5
59
+ version: 0.4.6
60
60
  - !ruby/object:Gem::Dependency
61
61
  name: onedrb
62
62
  requirement: !ruby/object:Gem::Requirement
@@ -101,22 +101,22 @@ dependencies:
101
101
  name: dom_render
102
102
  requirement: !ruby/object:Gem::Requirement
103
103
  requirements:
104
- - - "~>"
105
- - !ruby/object:Gem::Version
106
- version: '0.3'
107
104
  - - ">="
108
105
  - !ruby/object:Gem::Version
109
- version: 0.3.2
106
+ version: 0.4.0
107
+ - - "~>"
108
+ - !ruby/object:Gem::Version
109
+ version: '0.4'
110
110
  type: :runtime
111
111
  prerelease: false
112
112
  version_requirements: !ruby/object:Gem::Requirement
113
113
  requirements:
114
- - - "~>"
115
- - !ruby/object:Gem::Version
116
- version: '0.3'
117
114
  - - ">="
118
115
  - !ruby/object:Gem::Version
119
- version: 0.3.2
116
+ version: 0.4.0
117
+ - - "~>"
118
+ - !ruby/object:Gem::Version
119
+ version: '0.4'
120
120
  description:
121
121
  email: james@jamesrobertson.eu
122
122
  executables: []
metadata.gz.sig CHANGED
Binary file