diff options
-rw-r--r-- | col.go | 4 | ||||
-rw-r--r-- | picture.go | 4 | ||||
-rw-r--r-- | rows.go | 4 |
3 files changed, 6 insertions, 6 deletions
@@ -592,9 +592,9 @@ func (f *File) positionObjectPixels(sheet string, col, row, x1, y1, width, heigh } // Subtract the underlying cell heights to find end cell of the object. - for height >= f.getRowHeight(sheet, rowEnd) { - height -= f.getRowHeight(sheet, rowEnd) + for height >= f.getRowHeight(sheet, rowEnd+1) { rowEnd++ + height -= f.getRowHeight(sheet, rowEnd) } // The end vertices are whatever is left from the width and height. @@ -618,10 +618,10 @@ func (f *File) drawingResize(sheet string, cell string, width, height float64, f if inMergeCell { cellWidth, cellHeight = 0, 0 c, r = rng[0], rng[1] - for col := rng[0] - 1; col < rng[2]; col++ { + for col := rng[0]; col <= rng[2]; col++ { cellWidth += f.getColWidth(sheet, col) } - for row := rng[1] - 1; row < rng[3]; row++ { + for row := rng[1]; row <= rng[3]; row++ { cellHeight += f.getRowHeight(sheet, row) } } @@ -266,7 +266,7 @@ func (f *File) SetRowHeight(sheet string, row int, height float64) error { } // getRowHeight provides a function to get row height in pixels by given sheet -// name and row index. +// name and row number. func (f *File) getRowHeight(sheet string, row int) int { ws, _ := f.workSheetReader(sheet) for i := range ws.SheetData.Row { @@ -280,7 +280,7 @@ func (f *File) getRowHeight(sheet string, row int) int { } // GetRowHeight provides a function to get row height by given worksheet name -// and row index. For example, get the height of the first row in Sheet1: +// and row number. For example, get the height of the first row in Sheet1: // // height, err := f.GetRowHeight("Sheet1", 1) // |