Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix point calculation for twoWayOffset due to wrong angle direction #53

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions .github/workflows/Test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ on:
jobs:
test_ipad:
name: Test-iPad
runs-on: macOS-latest
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: List available Xcode versions
run: ls /Applications | grep Xcode
- name: Force Xcode 12.4
run: sudo xcode-select -switch /Applications/Xcode_12.4.app
- name: Force Xcode 14.2
run: sudo xcode-select -switch /Applications/Xcode_14.2.app
- name: List available simulators
run: xcrun simctl list
- name: Make project
Expand All @@ -23,14 +23,14 @@ jobs:
run: make test-iPad
test_iphone:
name: Test-iPhone
runs-on: macOS-latest
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: List available Xcode versions
run: ls /Applications | grep Xcode
- name: Force Xcode 12.4
run: sudo xcode-select -switch /Applications/Xcode_12.4.app
- name: Force Xcode 14.2
run: sudo xcode-select -switch /Applications/Xcode_14.2.app
- name: List available simulators
run: xcrun simctl list
- name: Make project
Expand All @@ -57,4 +57,3 @@ jobs:
run: make generate
- name: Run tests
run: make test-iPhone-iOS12

2 changes: 2 additions & 0 deletions Sources/Hammer/AppleInternal/AppleInternal+IOHID.swift
Original file line number Diff line number Diff line change
Expand Up @@ -205,3 +205,5 @@ extension IOHID {

let kGSEventPathInfoInRange: UInt8 = (1 << 0)
let kGSEventPathInfoInTouch: UInt8 = (1 << 1)

// swiftlint:enable type_name
2 changes: 1 addition & 1 deletion Sources/Hammer/Utilties/CoreGraphic+Extensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ extension CGPoint {
func twoWayOffset(_ distance: CGFloat, angle radians: CGFloat) -> [CGPoint] {
return [
self.offset(distance / 2, angle: radians),
self.offset(distance / 2, angle: .pi - radians),
self.offset(distance / 2, angle: .pi + radians),
]
}

Expand Down