Skip to content

Commit

Permalink
Merge pull request #29 from p-x9/feature/fix-location-label
Browse files Browse the repository at this point in the history
fixed coordinates displayed on label
  • Loading branch information
p-x9 authored Sep 5, 2023
2 parents f556c56 + 7200ac5 commit 5e5595f
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions Sources/TouchTracker/Cocoa/TouchTrackingUIView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -188,12 +188,14 @@ public class TouchTrackingUIView: UIView {
}
}

let locations = touches.map { $0.location(in: nil) }
let globalLocations = touches.map { $0.location(in: nil) }

zip(pointWindows, zip(locations, globalLocations)).forEach { window, location in
let (location, globalLocation) = location

zip(pointWindows, locations).forEach { window, location in
window.location = location
window.center = .init(x: location.x + offset.x,
y: location.y + offset.y)
window.center = .init(x: globalLocation.x + offset.x,
y: globalLocation.y + offset.y)

if shouldPropagateEventAcrossWindows,
let screen = self.window?.screen,
Expand Down

0 comments on commit 5e5595f

Please sign in to comment.