jamming 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.markdown +1 -1
- data/VERSION +1 -1
- data/jamming.gemspec +1 -1
- data/lib/jamming/png_formatter.rb +3 -5
- metadata +3 -3
data/README.markdown
CHANGED
@@ -20,7 +20,7 @@ Usage
|
|
20
20
|
f.write chord.to_png(:label => "Em7#9")
|
21
21
|
end
|
22
22
|
|
23
|
-
This will write Em7#9, <em>The Jimi Hendrix Chord</em>, to <tt
|
23
|
+
This will write Em7#9, <em>The Jimi Hendrix Chord</em>, to <tt>/tmp/old_good_jimi.png</tt>:
|
24
24
|
|
25
25
|
![Em7#9 - The Jimi Hendrix Chord](https://github.com/andmej/jamming/raw/master/examples/Em7%239.png)
|
26
26
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.2
|
data/jamming.gemspec
CHANGED
@@ -30,7 +30,6 @@ module Jamming
|
|
30
30
|
|
31
31
|
rvg = Magick::RVG.new(280, 210).viewbox(0,0,width,height) do |canvas|
|
32
32
|
canvas.background_fill = 'white'
|
33
|
-
x_div = @strings.size - 1
|
34
33
|
|
35
34
|
width_of_chord = 260
|
36
35
|
margin_side_of_chord = (width - width_of_chord) / 2
|
@@ -42,7 +41,7 @@ module Jamming
|
|
42
41
|
height_of_fret = height_of_chord / @number_of_frets
|
43
42
|
radius_of_finger = (height_of_fret * 0.6) / 2
|
44
43
|
|
45
|
-
width_of_fret = width_of_chord /
|
44
|
+
width_of_fret = width_of_chord / (@strings.size - 1)
|
46
45
|
|
47
46
|
# Draw all horizontal lines
|
48
47
|
(@number_of_frets+1).times do |n|
|
@@ -65,7 +64,7 @@ module Jamming
|
|
65
64
|
|
66
65
|
|
67
66
|
if [0,nil].include?(@frets[i])
|
68
|
-
# Add a
|
67
|
+
# Add a letter at the top. Either X or O.
|
69
68
|
canvas.text(i*width_of_fret+margin_side_of_chord, margin_top_of_chord - 6) do |txt|
|
70
69
|
txt.tspan((@frets[i] == 0 ? "O" : 'X').to_s).styles(
|
71
70
|
:text_anchor => 'middle',
|
@@ -93,8 +92,7 @@ module Jamming
|
|
93
92
|
:font_size => 36,
|
94
93
|
:font_family => 'helvetica',
|
95
94
|
:fill => 'black',
|
96
|
-
:font_weight => 'bold'
|
97
|
-
)
|
95
|
+
:font_weight => 'bold')
|
98
96
|
end
|
99
97
|
end
|
100
98
|
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 1
|
8
|
-
-
|
9
|
-
version: 0.1.
|
8
|
+
- 2
|
9
|
+
version: 0.1.2
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- "Andr\xC3\xA9s Mej\xC3\xADa"
|
@@ -124,7 +124,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
124
124
|
requirements:
|
125
125
|
- - ">="
|
126
126
|
- !ruby/object:Gem::Version
|
127
|
-
hash:
|
127
|
+
hash: 168576609755258433
|
128
128
|
segments:
|
129
129
|
- 0
|
130
130
|
version: "0"
|