flowkey / UIKit-cross-platform

Cross-platform Swift implementation of UIKit, mostly for Android
MIT License
598 stars 40 forks source link

Improve Touch Handling #265

Closed rikner closed 5 years ago

rikner commented 5 years ago

Fixes #217

Type of change:

Motivation (current vs expected behavior)

SDL's touch handling makes it impossible to get accurate timestamps on events, which breaks our velocity scrolling and causes other weird behaviour.

Please check if the PR fulfills these requirements

rikner commented 5 years ago

@janekszynal you might want have a look at my changes. I was able to correctly pass timestamp (maintaining the actual value) as JavaLong to the swift implementation of onNativeTouch by using @_cdecl instead of @_silgen_name. besides that very nice work! i think the factor of 0.4 for weightedAverageVelocity fits pretty good.

ephemer commented 5 years ago

Note to self: the current branch causes huge slowdowns with multitouch, we may need to reorganise some code to make this efficient

rikner commented 5 years ago

@ephemer @janek

closing this PR in favor of https://github.com/flowkey/UIKit-cross-platform/pull/282/files and https://github.com/flowkey/UIKit-cross-platform/pull/283/files