summaryrefslogtreecommitdiff
path: root/col.go
diff options
context:
space:
mode:
authorxuri <xuri.me@gmail.com>2019-04-12 11:32:26 +0800
committerGitHub <noreply@github.com>2019-04-12 11:32:26 +0800
commit8fff533b40111085f936075d7da12490be4a46a2 (patch)
tree879be7646d22b168fb017f88cd25f321257c8b78 /col.go
parent4e7d93a77796aa6814339d377a94d4b66226f1ce (diff)
parent8134197b07c5aa7615d97b586d69d8ff02f19df3 (diff)
Merge pull request #379 from yoshhiide/bug-calc-position-object
fix calc object position for addPicture
Diffstat (limited to 'col.go')
-rw-r--r--col.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/col.go b/col.go
index e3e057c..3660783 100644
--- a/col.go
+++ b/col.go
@@ -268,15 +268,15 @@ func (f *File) positionObjectPixels(sheet string, col, row, x1, y1, width, heigh
height += y1
// Subtract the underlying cell widths to find end cell of the object.
- for width >= f.getColWidth(sheet, colEnd) {
+ for width >= f.getColWidth(sheet, colEnd+1) {
colEnd++
width -= f.getColWidth(sheet, colEnd)
}
// Subtract the underlying cell heights to find end cell of the object.
for height >= f.getRowHeight(sheet, rowEnd) {
- rowEnd++
height -= f.getRowHeight(sheet, rowEnd)
+ rowEnd++
}
// The end vertices are whatever is left from the width and height.