lib/write_xlsx/shape.rb in write_xlsx-1.00.0 vs lib/write_xlsx/shape.rb in write_xlsx-1.01.0

- old
+ new

@@ -6,18 +6,18 @@ # Shape - A class for writing Excel shapes. # # Used in conjunction with WriteXLSX. # # Copyright 2000-2012, John McNamara, jmcnamara@cpan.org - # Converted to ruby by Hideo NAKAMURA, cxn03651@msj.biglobe.ne.jp + # Converted to ruby by Hideo NAKAMURA, nakamura.hideo@gmail.com # class Shape include Writexlsx::Utility attr_reader :edit_as, :type, :drawing attr_reader :tx_box, :fill, :line, :format - attr_reader :align, :valign + attr_reader :align, :valign, :anchor attr_accessor :name, :connect, :type, :id, :start, :end, :rotation attr_accessor :flip_h, :flip_v, :adjustments, :palette, :text, :stencil attr_accessor :row_start, :row_end, :column_start, :column_end attr_accessor :x1, :x2, :y1, :y2, :x_abs, :y_abs, :start_index, :end_index attr_accessor :x_offset, :y_offset, :width, :height, :scale_x, :scale_y @@ -181,14 +181,15 @@ @y2 = (yy2 * 9_525).to_i @x_abs = (x_abslt * 9_525).to_i @y_abs = (y_abslt * 9_525).to_i end - def set_position(row_start, column_start, x_offset, y_offset, x_scale, y_scale) + def set_position(row_start, column_start, x_offset, y_offset, x_scale, y_scale, anchor) @row_start = row_start @column_start = column_start @x_offset = x_offset || 0 @y_offset = y_offset || 0 + @anchor = anchor || 1 # Override shape scale if supplied as an argument. Otherwise, use the # existing shape scale factors. @scale_x = x_scale if x_scale @scale_y = y_scale if y_scale