|
@@ -1123,16 +1123,20 @@ class KMPDFEditViewController: KMPDFThumbViewBaseController {
|
|
|
// self.pdfDocument?.movePage(at: UInt(index), withPageAt: UInt(insertIndex+index))
|
|
|
}
|
|
|
|
|
|
+ var theToIndex = toIndex
|
|
|
+ if indexs.count == 1 {
|
|
|
+ theToIndex = insertIndex
|
|
|
+ }
|
|
|
if after {
|
|
|
var offset = 0
|
|
|
for index in indexs {
|
|
|
- self.pdfDocument?.movePage(at: UInt(index-offset), withPageAt: UInt(toIndex))
|
|
|
+ self.pdfDocument?.movePage(at: UInt(index-offset), withPageAt: UInt(theToIndex))
|
|
|
offset += 1
|
|
|
}
|
|
|
} else {
|
|
|
var offset = 0
|
|
|
for index in indexs.reversed() {
|
|
|
- self.pdfDocument?.movePage(at: UInt(index+offset), withPageAt: UInt(toIndex))
|
|
|
+ self.pdfDocument?.movePage(at: UInt(index+offset), withPageAt: UInt(theToIndex))
|
|
|
offset += 1
|
|
|
}
|
|
|
}
|