4 ms·
No pencilkit improvements :( Getting pencilkit and a webview to work properly together has been an impossible task. I haven't been able to find a way to draw
by aaomidi 5y ago
No pencilkit improvements :(
Getting pencilkit and a webview to work properly together has been an impossible task.
I haven't been able to find a way to draw on a WKWebView, while synchronizing both scrolling and zooming of the pencilkit and WkWebView.
:( there's so much potential there that I just can't extract.
- wll 5y agoSwizzle UIApplication.sendEvent to intercept the pencil touches sent to the WKWebView’s gestures and redirect them to an overlaid, disabled PKCanvasView’s intercepted gestures; call the original gestures’ touchesEnded. Cache the gestures in a weakToWeak NSMapTable for successive events. contentSize, contentOffset, and zoomScale syncing is trivial. I have it working even without swizzling using custom drawing engines. The issue lies within the dynamic and changing nature of the web and cross-device/size display unless you imagined it as one-off raster drawing.
- aaomidi 5y agoHmm I'll give this a try. Do you have this open-source so I can take a look?