gruffy 1.0.1 → 1.0.2
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
- data/lib/gruffy/base.rb +7 -4
- data/lib/gruffy/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7bb36cc9022990c3e7acafb52fb7674d0c44f7ba
|
4
|
+
data.tar.gz: 3b3700dd96bb4c696cecc2f15d51b852adfb74cc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8c2220f2b8870cad6b72a85f2a1e4b2f73a9335192e5d3c4c8a8f3b2dcbc00ab9cfbae3e61c8dd439ffac15daa6bdd11d5af45d2a370ae80ce3167edf17b4d26
|
7
|
+
data.tar.gz: a113978ddc2bee9f422fa4fa1af899874c9db2f9394d389e9855bbd375986f7ad843323b3aac8fd0f11fac20eca9008bc1d9ca7bd758eee1c37ae6bf8cb9b302
|
data/lib/gruffy/base.rb
CHANGED
@@ -210,6 +210,8 @@ module Gruffy
|
|
210
210
|
# Default 0
|
211
211
|
attr_accessor :label_rotation
|
212
212
|
|
213
|
+
attr_accessor :label_y_axis
|
214
|
+
|
213
215
|
# Background height of picture and ignoring content
|
214
216
|
attr_accessor :background_label_height
|
215
217
|
|
@@ -251,6 +253,7 @@ module Gruffy
|
|
251
253
|
@raw_columns = 800.0
|
252
254
|
@raw_rows = 800.0 * (@rows/@columns)
|
253
255
|
@background_label_height = 0
|
256
|
+
@label_y_axis = 0
|
254
257
|
@column_count = 0
|
255
258
|
@data = Array.new
|
256
259
|
@marker_count = nil
|
@@ -867,7 +870,7 @@ module Gruffy
|
|
867
870
|
end
|
868
871
|
end
|
869
872
|
|
870
|
-
y_offset += ((label_text.size - different_size) * 4) + 10 unless @label_rotation.nil?
|
873
|
+
y_offset += ((label_text.size - different_size) * 4) + 10 + @label_y_axis unless @label_rotation.nil?
|
871
874
|
if x_offset >= @graph_left && x_offset <= @graph_right
|
872
875
|
@d.rotation = (@label_rotation.to_i * (-1)) unless @label_rotation.nil?
|
873
876
|
@d.fill = @font_color
|
@@ -937,7 +940,7 @@ module Gruffy
|
|
937
940
|
|
938
941
|
# Make a new image at the current size with a solid +color+.
|
939
942
|
def render_solid_background(color)
|
940
|
-
@rows += (@background_label_height * 7)
|
943
|
+
@rows += (@background_label_height * 7)
|
941
944
|
Image.new(@columns, @rows) {
|
942
945
|
self.background_color = color
|
943
946
|
}
|
@@ -960,7 +963,7 @@ module Gruffy
|
|
960
963
|
gradient_fill = GradientFill.new(0, 0, 100, 0, top_color, bottom_color)
|
961
964
|
end
|
962
965
|
|
963
|
-
@rows += (@background_label_height * 7)
|
966
|
+
@rows += (@background_label_height * 7)
|
964
967
|
Image.new(@columns, @rows, gradient_fill)
|
965
968
|
end
|
966
969
|
|
@@ -975,7 +978,7 @@ module Gruffy
|
|
975
978
|
|
976
979
|
# Use with a theme to make a transparent background
|
977
980
|
def render_transparent_background
|
978
|
-
@rows += (@background_label_height * 7)
|
981
|
+
@rows += (@background_label_height * 7)
|
979
982
|
Image.new(@columns, @rows) do
|
980
983
|
self.background_color = 'transparent'
|
981
984
|
end
|
data/lib/gruffy/version.rb
CHANGED