Skip to content

Commit

Permalink
Update Magnet.framework to v3.3.0 (#57)
Browse files Browse the repository at this point in the history
* Update Magnet.framework v3.3.0

* Replace obsolete or deprecated methods
  • Loading branch information
Econa77 authored May 17, 2021
1 parent 5959744 commit 7bc6ed8
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions Cartfile.resolved
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
github "Clipy/Magnet" "v3.2.0"
github "Clipy/Sauce" "v2.1.0"
github "Clipy/Magnet" "v3.3.0"
github "Clipy/Sauce" "v2.2.0"
2 changes: 1 addition & 1 deletion KeyHolder.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ Pod::Spec.new do |s|
s.source_files = 'Lib/KeyHolder/**/*.swift'
s.swift_version = '5.0'
s.frameworks = 'Carbon', 'Cocoa'
s.dependency 'Magnet', '~> 3.2'
s.dependency 'Magnet', '~> 3.3.0'
end
4 changes: 2 additions & 2 deletions Lib/KeyHolder/RecordView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ open class RecordView: NSView {

private func drawModifiers(_ dirtyRect: NSRect) {
let fontSize = self.fontSize
let modifiers = keyCombo?.modifiers.convertSupportCocoaModifiers() ?? inputModifiers
let modifiers = keyCombo.map { NSEvent.ModifierFlags(carbonModifiers: $0.modifiers) } ?? inputModifiers
for (i, text) in validModifiersText.enumerated() {
let rect = NSRect(x: marginX + (fontSize * CGFloat(i)), y: marginY, width: fontSize, height: bounds.height)
text.draw(in: rect, withAttributes: modifierTextAttributes(modifiers, checkModifier: validModifiers[i]))
Expand Down Expand Up @@ -208,7 +208,7 @@ open class RecordView: NSView {

override open func performKeyEquivalent(with theEvent: NSEvent) -> Bool {
guard isFirstResponder else { return false }
guard let key = Sauce.shared.key(by: Int(theEvent.keyCode)) else { return false }
guard let key = Sauce.shared.key(for: Int(theEvent.keyCode)) else { return false }

if theEvent.modifierFlags.carbonModifiers() != 0 {
let modifiers = theEvent.modifierFlags.carbonModifiers()
Expand Down
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ let package = Package(
targets: ["KeyHolder"]),
],
dependencies: [
.package(url: "https://github.com/Clipy/Magnet", from: "3.2.0"),
.package(url: "https://github.com/Clipy/Magnet", .upToNextMinor(from: "3.3.0")),
],
targets: [
.target(
Expand Down

0 comments on commit 7bc6ed8

Please sign in to comment.