gtk2svg 0.3.9 → 0.3.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +3 -2
- data.tar.gz.sig +0 -0
- data/lib/gtk2svg.rb +15 -4
- metadata +8 -8
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3cd27c076a6295b4d03b26ce76fe32ef4052b82f
|
4
|
+
data.tar.gz: 0ec6e1a49c86a24545eb26f3fcd2eb711d582484
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d4541d4d14ead9a7ded5ad1661d732a84e34be7fffdbfd85ad2132e1441ed6cb47d181e86aa0ef5030a8c2c56ece7b7325065438d5d1b3723a782bb4c367fa46
|
7
|
+
data.tar.gz: fcd1359c7b79dfde12b8d75d9c4acdf8c744f28ead3d7525656c38d06d97166fdbc4e2a3151421443264e29985971f425f3dedcb29b32c86826bc4c007692bb3
|
checksums.yaml.gz.sig
CHANGED
@@ -1,2 +1,3 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
�S��ʗ����f�})(3:�dh��朐E��L��
|
2
|
+
�)�����=���+�H(��e�H8���BHt�@�P���۪cs|��}�ph�p��+���8/ߥ(}I�\͞S�'�=�[� �z�Os��]n�[#�����bb��[ZI>e�.��^W�8���i��!柸�}=q]�&���a���{�\F^��TV�
|
3
|
+
N�<dמ����%4������9�v:B����oZ�6����§Eu6�/�
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/gtk2svg.rb
CHANGED
@@ -81,8 +81,15 @@ module Gtk2SVG
|
|
81
81
|
[:script]
|
82
82
|
end
|
83
83
|
|
84
|
-
def svg(
|
85
|
-
|
84
|
+
def svg(e, attributes, raw_style)
|
85
|
+
|
86
|
+
style = style_filter(attributes).merge(raw_style)
|
87
|
+
|
88
|
+
style[:fill] = style.delete :'background-color'
|
89
|
+
h = attributes
|
90
|
+
width, height = %i(width height).map{|x| h[x].to_i }
|
91
|
+
|
92
|
+
[:draw_rectangle, [0, 0, width, height], style, render_all(e)]
|
86
93
|
end
|
87
94
|
|
88
95
|
def text(e, attributes, raw_style)
|
@@ -164,6 +171,7 @@ module Gtk2SVG
|
|
164
171
|
coords, style = args
|
165
172
|
|
166
173
|
x1, y1, x2, y2 = coords
|
174
|
+
|
167
175
|
gc = gc_ini(fill: style[:fill] || :none)
|
168
176
|
@area.window.draw_rectangle(gc, 1, x1, y1, x2, y2)
|
169
177
|
end
|
@@ -188,7 +196,8 @@ module Gtk2SVG
|
|
188
196
|
end
|
189
197
|
|
190
198
|
def render(a)
|
191
|
-
|
199
|
+
method(a[0]).call(args=a[1..2])
|
200
|
+
draw a[3]
|
192
201
|
end
|
193
202
|
|
194
203
|
def script(args)
|
@@ -198,7 +207,7 @@ module Gtk2SVG
|
|
198
207
|
private
|
199
208
|
|
200
209
|
def draw(a)
|
201
|
-
|
210
|
+
|
202
211
|
a.each do |rawx|
|
203
212
|
|
204
213
|
x, *remaining = rawx
|
@@ -260,6 +269,7 @@ module Gtk2SVG
|
|
260
269
|
|
261
270
|
@svg = svg
|
262
271
|
@doc = Svgle.new(svg, callback: self)
|
272
|
+
|
263
273
|
@area = area = Gtk::DrawingArea.new
|
264
274
|
client_code = []
|
265
275
|
|
@@ -281,6 +291,7 @@ module Gtk2SVG
|
|
281
291
|
end
|
282
292
|
|
283
293
|
a = Render.new(@doc).to_a
|
294
|
+
|
284
295
|
drawing = DrawingInstructions.new area
|
285
296
|
drawing.render a
|
286
297
|
end
|
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.
|
4
|
+
version: 0.3.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -62,7 +62,7 @@ dependencies:
|
|
62
62
|
version: '0.2'
|
63
63
|
- - ">="
|
64
64
|
- !ruby/object:Gem::Version
|
65
|
-
version: 0.2.
|
65
|
+
version: 0.2.2
|
66
66
|
type: :runtime
|
67
67
|
prerelease: false
|
68
68
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -72,27 +72,27 @@ dependencies:
|
|
72
72
|
version: '0.2'
|
73
73
|
- - ">="
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: 0.2.
|
75
|
+
version: 0.2.2
|
76
76
|
- !ruby/object:Gem::Dependency
|
77
77
|
name: svgle
|
78
78
|
requirement: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: '0.
|
82
|
+
version: '0.3'
|
83
83
|
- - ">="
|
84
84
|
- !ruby/object:Gem::Version
|
85
|
-
version: 0.
|
85
|
+
version: 0.3.1
|
86
86
|
type: :runtime
|
87
87
|
prerelease: false
|
88
88
|
version_requirements: !ruby/object:Gem::Requirement
|
89
89
|
requirements:
|
90
90
|
- - "~>"
|
91
91
|
- !ruby/object:Gem::Version
|
92
|
-
version: '0.
|
92
|
+
version: '0.3'
|
93
93
|
- - ">="
|
94
94
|
- !ruby/object:Gem::Version
|
95
|
-
version: 0.
|
95
|
+
version: 0.3.1
|
96
96
|
description:
|
97
97
|
email: james@r0bertson.co.uk
|
98
98
|
executables: []
|
@@ -112,7 +112,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
112
112
|
requirements:
|
113
113
|
- - ">="
|
114
114
|
- !ruby/object:Gem::Version
|
115
|
-
version:
|
115
|
+
version: 2.1.0
|
116
116
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
117
117
|
requirements:
|
118
118
|
- - ">="
|
metadata.gz.sig
CHANGED
Binary file
|