Skip to content
This repository has been archived by the owner on Sep 23, 2019. It is now read-only.

Commit

Permalink
Adonit: add coalesced touch handling
Browse files Browse the repository at this point in the history
  • Loading branch information
rofreg committed Jun 16, 2016
1 parent a3247b3 commit 39064f4
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions PinchPad/Canvas.swift
Original file line number Diff line number Diff line change
Expand Up @@ -214,18 +214,24 @@ class Canvas: UIView {
extension Canvas : JotStrokeDelegate {
// MARK: Adonit event handling handling
func jotStylusStrokeBegan(stylusStroke: JotStroke) {
let location = stylusStroke.locationInView(self)
strokeBegan(atPoint: location, withPressure: stylusStroke.adjustedPressure)
for jotStroke in stylusStroke.coalescedJotStrokes as! [JotStroke]! {
let location = jotStroke.locationInView(self)
strokeBegan(atPoint: location, withPressure: jotStroke.adjustedPressure)
}
}

func jotStylusStrokeMoved(stylusStroke: JotStroke) {
let location = stylusStroke.locationInView(self)
strokeMoved(toPoint: location, withPressure: stylusStroke.adjustedPressure)
for jotStroke in stylusStroke.coalescedJotStrokes as! [JotStroke]! {
let location = jotStroke.locationInView(self)
strokeMoved(toPoint: location, withPressure: jotStroke.adjustedPressure)
}
}

func jotStylusStrokeEnded(stylusStroke: JotStroke) {
let location = stylusStroke.locationInView(self)
strokeEnded(atPoint: location, withPressure: stylusStroke.adjustedPressure)
for jotStroke in stylusStroke.coalescedJotStrokes as! [JotStroke]! {
let location = jotStroke.locationInView(self)
strokeEnded(atPoint: location, withPressure: jotStroke.adjustedPressure)
}
}

func jotStylusStrokeCancelled(stylusStroke: JotStroke) {
Expand Down

0 comments on commit 39064f4

Please sign in to comment.