gtk2svg 0.3.6 → 0.3.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +4 -2
- data.tar.gz.sig +0 -0
- data/lib/gtk2svg.rb +19 -3
- metadata +2 -2
- 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: c5be3754156b1ec03b679394e67fb8868014ca80
|
4
|
+
data.tar.gz: bae9e68e7fba17040185e0d7d65c64836fb7aa07
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2725b4b317ad74dadcdde1d8e7e55abdce0191df832baabe566e35fa1954e8f6629933297c0fa5e4521b0f32f4a30b638065e0f3d6ad46db927375f35afe4c38
|
7
|
+
data.tar.gz: 913875d76a66c881235ef872c48d2aea2d34a738c462a415ff591970e0f04dac8f57bded1f340edbb7f749941c97025818d4f1acd933dd164252689388a15915
|
checksums.yaml.gz.sig
CHANGED
@@ -1,2 +1,4 @@
|
|
1
|
-
�
|
2
|
-
�
|
1
|
+
:�\J��-a�5��Z�Ļ�sY1��1q�f�s_�6K];����j�Ej���u5-O���[(�Ѽ�reo3�o�7�b5.b@L�<ug���"� �J�D�!�}�F�|� ����0��
|
2
|
+
"[�H��&p��Ϩ�J����Vw!4��D�-�_8��@�ʨu:��\!�Y��0�i?
|
3
|
+
J
|
4
|
+
l�{nlw<@��.��#����7c���@�y�Ϗ�x�IDn���o�%64\��x��$����٨�ܩ
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/gtk2svg.rb
CHANGED
@@ -7,9 +7,6 @@ require 'dom_render'
|
|
7
7
|
require 'svgle'
|
8
8
|
|
9
9
|
|
10
|
-
# Description: Experimental gem to render SVG within an GTK2 application.
|
11
|
-
|
12
|
-
|
13
10
|
module Gtk2SVG
|
14
11
|
|
15
12
|
class Render < DomRender
|
@@ -45,6 +42,14 @@ module Gtk2SVG
|
|
45
42
|
[:draw_line, [x1, y1, x2, y2], style, render_all(e)]
|
46
43
|
end
|
47
44
|
|
45
|
+
def polygon(e, attributes, style)
|
46
|
+
|
47
|
+
points = attributes[:points].split(/\s+/). \
|
48
|
+
map {|x| x.split(/\s*,\s*/).map(&:to_i)}
|
49
|
+
|
50
|
+
[:draw_polygon, points, style, render_all(e)]
|
51
|
+
end
|
52
|
+
|
48
53
|
def rect(e, attributes, style)
|
49
54
|
|
50
55
|
h = attributes
|
@@ -105,6 +110,17 @@ module Gtk2SVG
|
|
105
110
|
Gdk::GC::CAP_NOT_LAST, Gdk::GC::JOIN_MITER)
|
106
111
|
@area.window.draw_line(gc, x1, y1, x2, y2)
|
107
112
|
end
|
113
|
+
|
114
|
+
def draw_polygon(args)
|
115
|
+
|
116
|
+
points, style = args
|
117
|
+
|
118
|
+
|
119
|
+
gc = gc_ini(fill: style[:fill] || :none, stroke: style[:stroke] || :none)
|
120
|
+
gc.set_line_attributes(style[:stroke_width].to_i, Gdk::GC::LINE_SOLID, \
|
121
|
+
Gdk::GC::CAP_NOT_LAST, Gdk::GC::JOIN_MITER)
|
122
|
+
@area.window.draw_polygon(gc, 1, points)
|
123
|
+
end
|
108
124
|
|
109
125
|
def draw_rectangle(args)
|
110
126
|
|
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.7
|
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-
|
34
|
+
date: 2015-11-24 00:00:00.000000000 Z
|
35
35
|
dependencies:
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: gtk2
|
metadata.gz.sig
CHANGED
Binary file
|