@@ -450,42 +450,42 @@ class Window: NSWindow, NSWindowDelegate {
450
450
}
451
451
452
452
func adjustFrameEdge( frame: inout NSRect ,
453
- frameValue: CGFloat , targetValue: CGFloat ,
453
+ frameValue: CGFloat , targetValue: CGFloat ,
454
454
isHorizontal: Bool , isMax: Bool ) {
455
455
let overAmount = isMax ?
456
456
( frameValue - targetValue) :
457
457
( targetValue - frameValue)
458
-
458
+
459
459
if overAmount > 0 {
460
460
let pullBackFactor = min ( 1 , overAmount / 20 )
461
461
let adjustment = 2 * pullBackFactor
462
-
462
+
463
463
if isHorizontal {
464
464
frame. origin. x += isMax ?
465
- - ( overAmount + adjustment) :
465
+ - ( overAmount + adjustment) :
466
466
adjustment
467
467
} else {
468
468
frame. origin. y += isMax ?
469
- - ( overAmount + adjustment) :
469
+ - ( overAmount + adjustment) :
470
470
adjustment
471
471
}
472
472
}
473
473
}
474
474
475
475
adjustFrameEdge ( frame: & newFrame,
476
- frameValue: newFrame. maxX, targetValue: targetFrame. maxX,
476
+ frameValue: newFrame. maxX, targetValue: targetFrame. maxX,
477
477
isHorizontal: true , isMax: true )
478
478
479
479
adjustFrameEdge ( frame: & newFrame,
480
- frameValue: newFrame. minX, targetValue: targetFrame. minX,
480
+ frameValue: newFrame. minX, targetValue: targetFrame. minX,
481
481
isHorizontal: true , isMax: false )
482
482
483
483
adjustFrameEdge ( frame: & newFrame,
484
- frameValue: newFrame. maxY, targetValue: targetFrame. maxY,
484
+ frameValue: newFrame. maxY, targetValue: targetFrame. maxY,
485
485
isHorizontal: false , isMax: true )
486
486
487
487
adjustFrameEdge ( frame: & newFrame,
488
- frameValue: newFrame. minY, targetValue: targetFrame. minY,
488
+ frameValue: newFrame. minY, targetValue: targetFrame. minY,
489
489
isHorizontal: false , isMax: false )
490
490
491
491
return newFrame
0 commit comments