gtk2svg 0.3.10 → 0.3.11

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: 3cd27c076a6295b4d03b26ce76fe32ef4052b82f
4
- data.tar.gz: 0ec6e1a49c86a24545eb26f3fcd2eb711d582484
3
+ metadata.gz: 19688326432c2cd02b4c5caae879363862998286
4
+ data.tar.gz: aac9a49df6b150058c1ec845ccbc289c6722f89f
5
5
  SHA512:
6
- metadata.gz: d4541d4d14ead9a7ded5ad1661d732a84e34be7fffdbfd85ad2132e1441ed6cb47d181e86aa0ef5030a8c2c56ece7b7325065438d5d1b3723a782bb4c367fa46
7
- data.tar.gz: fcd1359c7b79dfde12b8d75d9c4acdf8c744f28ead3d7525656c38d06d97166fdbc4e2a3151421443264e29985971f425f3dedcb29b32c86826bc4c007692bb3
6
+ metadata.gz: abb83cb96b30a96d6c967e553ca5f3817fbd3fc819945c9550068efea447c3a7d5867e7aa8f09a023719dc737d036147c1c92f7ea1378401da916e30b1f35606
7
+ data.tar.gz: 7be8bfd701976e640b21006caa4806b8e5cb925d193f28d1592778428d9bafb5fa5ce739adf59d9f605a4eb470da5dc718af88afd9df958583335dc2afd0f838
checksums.yaml.gz.sig CHANGED
Binary file
data.tar.gz.sig CHANGED
Binary file
data/lib/gtk2svg.rb CHANGED
@@ -6,7 +6,7 @@ require 'gtk2'
6
6
  require 'dom_render'
7
7
  require 'svgle'
8
8
 
9
- # Description: Experimental gem to render SVG within an GTK2 application.
9
+ # Description: Experimental gem to render SVG within a GTK2 application.
10
10
 
11
11
 
12
12
 
@@ -282,14 +282,8 @@ module Gtk2SVG
282
282
 
283
283
  area.signal_connect("expose_event") do
284
284
 
285
- Thread.new do
286
-
287
- @doc.root.each_recursive do |x|
288
- eval x.text.unescape if x.name == 'script'
289
- end
290
-
291
- end
292
-
285
+ Thread.new { @doc.root.xpath('//script').each {|x| eval x.text.unescape } }
286
+
293
287
  a = Render.new(@doc).to_a
294
288
 
295
289
  drawing = DrawingInstructions.new area
@@ -300,12 +294,9 @@ module Gtk2SVG
300
294
 
301
295
  area.signal_connect('motion_notify_event') do |item, event|
302
296
 
303
- @doc.root.each_recursive do |x|
297
+ @doc.root.xpath('//*[@onmousemove]').each do |x|
304
298
 
305
- if x.attributes[:onmousemove] and x.hotspot? event.x, event.y then
306
- #onmousemove(event.x,event.y)
307
- eval x.onmousemove()
308
- end
299
+ eval x.onmousemove() if x.hotspot? event.x, event.y
309
300
 
310
301
  end
311
302
  end
@@ -314,13 +305,9 @@ module Gtk2SVG
314
305
 
315
306
  area.signal_connect "button_press_event" do |item,event|
316
307
 
317
- @doc.root.each_recursive do |x|
308
+ @doc.root.xpath('//*[@onmousedown]').each do |x|
318
309
 
319
- if x.attributes[:onmousedown] and x.hotspot? event.x, event.y then
320
-
321
- eval x.onmousedown()
322
-
323
- end
310
+ eval x.onmousedown() if x.hotspot? event.x, event.y
324
311
 
325
312
  end
326
313
  end
@@ -336,6 +323,7 @@ module Gtk2SVG
336
323
  end
337
324
 
338
325
  def refresh()
326
+ @dirty = true
339
327
  @area.queue_draw
340
328
  end
341
329
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gtk2svg
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.10
4
+ version: 0.3.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -31,7 +31,7 @@ cert_chain:
31
31
  fnNu6z0ydxzHCvBhE0pU4jDzxPTASZiyllpSpQgz9OX3DAlUgWFQLHmj1hGk6GH4
32
32
  QldMu2GTc/3h2w==
33
33
  -----END CERTIFICATE-----
34
- date: 2015-11-24 00:00:00.000000000 Z
34
+ date: 2015-11-25 00:00:00.000000000 Z
35
35
  dependencies:
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: gtk2
metadata.gz.sig CHANGED
Binary file