|
@@ -525,7 +525,12 @@ extension KMEditPDfHanddler {
|
|
|
position.y += 26
|
|
|
|
|
|
position.x += (areaBounds.size.width*0.5-win.frame.size.width*0.5)
|
|
|
- let x = max(0, position.x)
|
|
|
+ var x = max(0, position.x)
|
|
|
+ let width = win.frame.size.width
|
|
|
+ let offsetX = x + width - NSMaxX(winFrame)
|
|
|
+ if offsetX > 0 { // 超出右编辑
|
|
|
+ x -= offsetX
|
|
|
+ }
|
|
|
var y = max(0, position.y)
|
|
|
|
|
|
let screenFrame = NSScreen.main?.frame ?? .zero
|
|
@@ -533,7 +538,7 @@ extension KMEditPDfHanddler {
|
|
|
y = screenFrame.size.height - 44 - 40
|
|
|
}
|
|
|
|
|
|
- let wframe = NSMakeRect(x, y, win.frame.size.width, 44)
|
|
|
+ let wframe = NSMakeRect(x, y, width, 44)
|
|
|
win.setFrame(wframe, display: true)
|
|
|
|
|
|
if CGRectContainsRect(winFrame, wframe) == false {
|