diff options
| author | Randy Morgan <[email protected]> | 2012-05-03 18:41:22 +0900 |
|---|---|---|
| committer | Randy Morgan <[email protected]> | 2012-05-03 18:41:22 +0900 |
| commit | 4c4ef3cea3700fe0758542dc33ea4ab4bafbc809 (patch) | |
| tree | 546264ca9713098dba48b86223384bbecb1d785a /lib/axlsx/drawing/view_3D.rb | |
| parent | 2470d612d94887d042b0b970936d59258dcf5c01 (diff) | |
| download | caxlsx-4c4ef3cea3700fe0758542dc33ea4ab4bafbc809.tar.gz caxlsx-4c4ef3cea3700fe0758542dc33ea4ab4bafbc809.zip | |
alter REGEX validators for percentages so we can pass in an integer or string value without the %. The specification indicates that the expression should include the %, but excel will only pay attention to the value without the '%' sign.
Diffstat (limited to 'lib/axlsx/drawing/view_3D.rb')
| -rw-r--r-- | lib/axlsx/drawing/view_3D.rb | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/axlsx/drawing/view_3D.rb b/lib/axlsx/drawing/view_3D.rb index 1090f4a7..07586b5f 100644 --- a/lib/axlsx/drawing/view_3D.rb +++ b/lib/axlsx/drawing/view_3D.rb @@ -4,10 +4,10 @@ module Axlsx class View3D # Validation for hPercent - H_PERCENT_REGEX = /0*(([5-9])|([1-9][0-9])|([1-4][0-9][0-9])|500)%/ + H_PERCENT_REGEX = /0*(([5-9])|([1-9][0-9])|([1-4][0-9][0-9])|500)/ # validation for depthPercent - DEPTH_PERCENT_REGEX = /0*(([2-9][0-9])|([1-9][0-9][0-9])|(1[0-9][0-9][0-9])|2000)%/ + DEPTH_PERCENT_REGEX = /0*(([2-9][0-9])|([1-9][0-9][0-9])|(1[0-9][0-9][0-9])|2000)/ # x rotation for the chart # must be between -90 and 90 @@ -55,7 +55,10 @@ module Axlsx def rotX=(v) DataTypeValidator.validate "#{self.class}.rotX", [Integer, Fixnum], v, lambda {|arg| arg >= -90 && arg <= 90 }; @rotX = v; end # @see hPercent - def hPercent=(v) RegexValidator.validate "#{self.class}.rotX", H_PERCENT_REGEX, v; @hPercent = v; end + def hPercent=(v) + RegexValidator.validate "#{self.class}.hPercent", H_PERCENT_REGEX, v + @hPercent = v + end # @see rotY def rotY=(v) DataTypeValidator.validate "#{self.class}.rotY", [Integer, Fixnum], v, lambda {|arg| arg >= 0 && arg <= 360 }; @rotY = v; end |
