Ver Fonte

最后一个字超格问题处理

loubw há 4 dias atrás
pai
commit
603cea7ca3
2 ficheiros alterados com 2 adições e 2 exclusões
  1. 1 1
      fpdf.go
  2. 1 1
      splittext.go

+ 1 - 1
fpdf.go

@@ -2763,7 +2763,6 @@ func (f *Fpdf) MultiCell(w, h float64, txtStr, borderStr, alignStr string, fill
 			//	/////////
 			//	i = sep
 			//}
-			i++
 			lines = append(lines, s[j:i])
 			if f.ws > 0 {
 				f.ws = 0
@@ -2776,6 +2775,7 @@ func (f *Fpdf) MultiCell(w, h float64, txtStr, borderStr, alignStr string, fill
 			}
 			//sep = -1
 			j = i
+			i++
 			l = 0
 			//ns = 0
 			nl++

+ 1 - 1
splittext.go

@@ -53,10 +53,10 @@ func (f *Fpdf) SplitText(txt string, w float64) (lines []string) {
 			//	//////////////
 			//	i = sep
 			//}
-			i++
 			lines = append(lines, string(s[j:i]))
 			//sep = -1
 			j = i
+			i++
 			l = 0
 		} else {
 			i++