Skip to content

Commit

Permalink
Merge pull request #1 from zenangst/improve/quadrant-resizing
Browse files Browse the repository at this point in the history
Improve quadrant resizing
  • Loading branch information
zenangst committed May 6, 2020
2 parents aa3eb6a + 9d67ab4 commit 2181027
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion Source/MouseController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ final class MouseController {
private var debugWindow: NSWindow?
private var delta: CGPoint?
private var windowFrameCache: CGRect?
private var lastQuadrant: Quadrant?
private let accessibilityController: AccessibilityController
private let resizeBehavior: MouseResizeBehavior

Expand Down Expand Up @@ -74,6 +75,7 @@ final class MouseController {
self.monitor = nil
self.delta = nil
self.windowFrameCache = nil
self.lastQuadrant = nil
}
}

Expand Down Expand Up @@ -105,7 +107,8 @@ final class MouseController {
case .quadrant:
guard var windowFrame = windowFrameCache ?? elementWindow.frame else { return }

let quadrant = windowFrame.quadrant(for: point)
let quadrant = lastQuadrant ?? windowFrame.quadrant(for: point)
self.lastQuadrant = quadrant

switch quadrant {
case .first:
Expand Down
2 changes: 1 addition & 1 deletion XcodeGen/MouseDef.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ targets:
settings:
base:
PRODUCT_BUNDLE_IDENTIFIER: "com.zenangst.MouseDef"
MARKETING_VERSION: "0.0.1"
MARKETING_VERSION: "0.0.2"
CURRENT_PROJECT_VERSION: 1
INFOPLIST_FILE: "Resources/Info.plist"
ASSETCATALOG_COMPILER_APPICON_NAME: "Assets"
Expand Down

0 comments on commit 2181027

Please sign in to comment.