gruffy 0.0.7 → 0.1.0

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: 6c97d5042a4c687f64530d916564e32cea0119c4
4
- data.tar.gz: ab8e65fc53e10130e210ef0fa19745b2e2c3fcfe
3
+ metadata.gz: 4a2e0aba18f99a0d0ad130505bf71d8024eadc91
4
+ data.tar.gz: 004531b5e248e45eeaa3a445d7c21a13a3b3e179
5
5
  SHA512:
6
- metadata.gz: c9aa95210b02c7ead2e5f1efcbe92c8044b0d0923aaf208514d29f3027fe753569e844542b45e82b908abe5f49ae7c21dce6347f7ba44168667fa8eea054b962
7
- data.tar.gz: 34ab411662fb20f443545070ef6b76a9d6b7475ee016700cae994b12c455c8c0e417dbdd645aa5001b3623089159006a175b97ab889457c8d14a534247424b49
6
+ metadata.gz: 3fa05615c1af2e5e7eaac57e93ef02d7685bf0d84fd148bb6fe373e959a031cd4a01ce60d0e6d3187d0bf43415e011669f8579b3621d48bf68e2d6f6bbdc5699
7
+ data.tar.gz: 2511f546e04460ffdbc8bf9aa1e654b4eab8d3ce7861f78eca26c027e50d51561d44d1791d1e17f502403771a7358426c5b2d7313524711fc4d9858c0ad0141e
@@ -1,6 +1,7 @@
1
1
  require 'rubygems'
2
2
  require 'rmagick'
3
3
  require 'bigdecimal'
4
+ require 'pp'
4
5
 
5
6
  require File.dirname(__FILE__) + '/deprecated'
6
7
 
@@ -451,7 +452,6 @@ module Gruffy
451
452
  end
452
453
  end
453
454
 
454
-
455
455
  protected
456
456
 
457
457
  # Overridden by subclasses to do the actual plotting of the graph.
@@ -863,9 +863,9 @@ module Gruffy
863
863
  end
864
864
  end
865
865
 
866
- y_offset += ((label_text.size - different_size) * 4) + 10 if @label_rotation.present?
866
+ y_offset += ((label_text.size - different_size) * 4) + 10 unless @label_rotation.nil?
867
867
  if x_offset >= @graph_left && x_offset <= @graph_right
868
- @d.rotation = (@label_rotation.to_i * (-1)) if @label_rotation.present?
868
+ @d.rotation = (@label_rotation.to_i * (-1)) unless @label_rotation.nil?
869
869
  @d.fill = @font_color
870
870
  @d.font = @font if @font
871
871
  @d.stroke('transparent')
@@ -876,7 +876,7 @@ module Gruffy
876
876
  1.0, 1.0,
877
877
  x_offset, y_offset,
878
878
  label_text, @scale)
879
- @d.rotation = @label_rotation.to_i if @label_rotation.present?
879
+ @d.rotation = @label_rotation.to_i unless @label_rotation.nil?
880
880
  end
881
881
  @labels_seen[index] = 1
882
882
  debug { @d.line 0.0, y_offset, @raw_columns, y_offset }
@@ -933,6 +933,7 @@ module Gruffy
933
933
 
934
934
  # Make a new image at the current size with a solid +color+.
935
935
  def render_solid_background(color)
936
+ @rows += ((@rows * 20) / 100) unless @label_rotation.nil?
936
937
  Image.new(@columns, @rows) {
937
938
  self.background_color = color
938
939
  }
@@ -954,7 +955,8 @@ module Gruffy
954
955
  else
955
956
  gradient_fill = GradientFill.new(0, 0, 100, 0, top_color, bottom_color)
956
957
  end
957
- @rows += (@rows*10/100) if @label_rotation.present?
958
+
959
+ @rows += ((@rows * 20) / 100) unless @label_rotation.nil?
958
960
  Image.new(@columns, @rows, gradient_fill)
959
961
  end
960
962
 
@@ -969,6 +971,7 @@ module Gruffy
969
971
 
970
972
  # Use with a theme to make a transparent background
971
973
  def render_transparent_background
974
+ @rows += ((@rows * 20) / 100) unless @label_rotation.nil?
972
975
  Image.new(@columns, @rows) do
973
976
  self.background_color = 'transparent'
974
977
  end
@@ -1,3 +1,3 @@
1
1
  module Gruffy
2
- VERSION = '0.0.7'
2
+ VERSION = '0.1.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gruffy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Wuttikrai Limsakul
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-06-03 00:00:00.000000000 Z
11
+ date: 2016-06-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rmagick