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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a8a588f8fea5f65239b91f3e078008cc32e9a972
4
- data.tar.gz: f9b5c1cdfab226c55226ec03bc0b82a732d5a033
3
+ metadata.gz: 7bb36cc9022990c3e7acafb52fb7674d0c44f7ba
4
+ data.tar.gz: 3b3700dd96bb4c696cecc2f15d51b852adfb74cc
5
5
  SHA512:
6
- metadata.gz: bda392712d72cbe34cad4b2bb56e8fcbea3e7562644a229eac1f75374fc61702cc117291b7640516ed8eed32b7e7731f934f94c5169c2cf199fa64f49a8b12d7
7
- data.tar.gz: 7bfd3eed6244aa7f97d0e72faa44361ac1b03e776467109280ce5828f288fdb5ce2aadc36bf8dce783f1b0198382081c42deac69b06131a19e0a56c60ae8e402
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) unless @label_rotation.nil?
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) unless @label_rotation.nil?
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) unless @label_rotation.nil?
981
+ @rows += (@background_label_height * 7)
979
982
  Image.new(@columns, @rows) do
980
983
  self.background_color = 'transparent'
981
984
  end
@@ -1,3 +1,3 @@
1
1
  module Gruffy
2
- VERSION = '1.0.1'
2
+ VERSION = '1.0.2'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gruffy
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Wuttikrai Limsakul