summaryrefslogtreecommitdiffhomepage
path: root/lib/axlsx/drawing/drawing.rb
diff options
context:
space:
mode:
authorRandy Morgan <[email protected]>2012-05-26 14:40:24 +0900
committerRandy Morgan <[email protected]>2012-05-26 14:40:24 +0900
commitea66a00e1a6275ce263ba943c45d1e6ff844eb0c (patch)
tree4d71435599dbc842b6ab119633d771b07a5ab3a5 /lib/axlsx/drawing/drawing.rb
parentddb30e7e45e88082c268b902e60f62d48d855c70 (diff)
downloadcaxlsx-ea66a00e1a6275ce263ba943c45d1e6ff844eb0c.tar.gz
caxlsx-ea66a00e1a6275ce263ba943c45d1e6ff844eb0c.zip
add in two cell anchors for images.
Diffstat (limited to 'lib/axlsx/drawing/drawing.rb')
-rw-r--r--lib/axlsx/drawing/drawing.rb9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/axlsx/drawing/drawing.rb b/lib/axlsx/drawing/drawing.rb
index 943c0f2d..b06130f1 100644
--- a/lib/axlsx/drawing/drawing.rb
+++ b/lib/axlsx/drawing/drawing.rb
@@ -68,11 +68,16 @@ module Axlsx
@anchors = SimpleTypedList.new [TwoCellAnchor, OneCellAnchor]
end
- # Adds an image to the chart
+ # Adds an image to the chart If th end_at option is specified we create a two cell anchor. By default we use a one cell anchor.
# @note The recommended way to manage images is to use Worksheet.add_image. Please refer to that method for documentation.
# @see Worksheet#add_image
+ # @return [Pic]
def add_image(options={})
- OneCellAnchor.new(self, options)
+ if options[:end_at]
+ TwoCellAnchor.new(self, options).add_pic(options)
+ else
+ OneCellAnchor.new(self, options)
+ end
@anchors.last.object
end