def position_object_pixels(col_start, row_start, x1, y1, width, height) #:nodoc:
      # Calculate the absolute x offset of the top-left vertex.
      if @col_size_changed
        x_abs = (0 .. col_start-1).inject(0) {|sum, col| sum += size_col(col)}
      else
        # Optimisation for when the column widths haven't changed.
        x_abs = @default_col_pixels * col_start
      end
      x_abs += x1

      # Calculate the absolute y offset of the top-left vertex.
      # Store the column change to allow optimisations.
      if @row_size_changed
        y_abs = (0 .. row_start-1).inject(0) {|sum, row| sum += size_row(row)}
      else
        # Optimisation for when the row heights haven't changed.
        y_abs = @default_row_pixels * row_start
      end
      y_abs += y1

      # Adjust start column for offsets that are greater than the col width.
      x1, col_start = adjust_column_offset(x1, col_start)

      # Adjust start row for offsets that are greater than the row height.
      y1, row_start = adjust_row_offset(y1, row_start)

      # Initialise end cell to the same as the start cell.
      col_end = col_start
      row_end = row_start

      width  += x1
      height += y1

      # Subtract the underlying cell widths to find the end cell of the object.
      width, col_end = adjust_column_offset(width, col_end)

      # Subtract the underlying cell heights to find the end cell of the object.
      height, row_end = adjust_row_offset(height, row_end)

      # The end vertices are whatever is left from the width and height.
      x2 = width
      y2 = height

      [col_start, row_start, x1, y1, col_end, row_end, x2, y2, x_abs, y_abs]
    end
def position_object_pixels(col_start, row_start, x1, y1, width, height) #:nodoc:
      # Calculate the absolute x offset of the top-left vertex.
      if @col_size_changed
        x_abs = (0 .. col_start-1).inject(0) {|sum, col| sum += size_col(col)}
      else
        # Optimisation for when the column widths haven't changed.
        x_abs = @default_col_pixels * col_start
      end
      x_abs += x1

      # Calculate the absolute y offset of the top-left vertex.
      # Store the column change to allow optimisations.
      if @row_size_changed
        y_abs = (0 .. row_start-1).inject(0) {|sum, row| sum += size_row(row)}
      else
        # Optimisation for when the row heights haven't changed.
        y_abs = @default_row_pixels * row_start
      end
      y_abs += y1

      # Adjust start column for offsets that are greater than the col width.
      x1, col_start = adjust_column_offset(x1, col_start)

      # Adjust start row for offsets that are greater than the row height.
      y1, row_start = adjust_row_offset(y1, row_start)

      # Initialise end cell to the same as the start cell.
      col_end = col_start
      row_end = row_start

      width  += x1
      height += y1

      # Subtract the underlying cell widths to find the end cell of the object.
      width, col_end = adjust_column_offset(width, col_end)

      # Subtract the underlying cell heights to find the end cell of the object.
      height, row_end = adjust_row_offset(height, row_end)

      # The end vertices are whatever is left from the width and height.
      x2 = width
      y2 = height

      [col_start, row_start, x1, y1, col_end, row_end, x2, y2, x_abs, y_abs]
    end
Calculate the vertices that define the position of a graphical object within
 the worksheet in pixels.

         +------------+------------+
         |     A      |      B     |
   +-----+------------+------------+
   |     |(x1,y1)     |            |
   |  1  |(A1)._______|______      |
   |     |    |              |     |
   |     |    |              |     |
   +-----+----|    Object    |-----+
   |     |    |              |     |
   |  2  |    |______________.     |
   |     |            |        (B2)|
   |     |            |     (x2,y2)|
   +---- +------------+------------+

 Example of an object that covers some of the area from cell A1 to cell B2.

 Based on the width and height of the object we need to calculate 8 vars:

     col_start, row_start, col_end, row_end, x1, y1, x2, y2.

 We also calculate the absolute x and y position of the top left vertex of
 the object. This is required for images.

    x_abs, y_abs

 The width and height of the cells that the object occupies can be variable
 and have to be taken into account.

 The values of col_start and row_start are passed in from the calling
 function. The values of col_end and row_end are calculated by subtracting
 the width and height of the object from the width and height of the
 underlying cells.

    col_start    # Col containing upper left corner of object.
    x1           # Distance to left side of object.
    row_start    # Row containing top left corner of object.
    y1           # Distance to top of object.
    col_end      # Col containing lower right corner of object.
    x2           # Distance to right side of object.
    row_end      # Row containing bottom right corner of object.
    y2           # Distance to bottom of object.
    width        # Width of object frame.
    height       # Height of object frame.