-
Notifications
You must be signed in to change notification settings - Fork 8
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
Can’t draw anything without setting touch-action #2
Comments
There's quite a lot of subtle variability between browsers regarding pointer events - which I'm hoping will work themselves out over time. Firefox (and Safari) reports the mouse as having 0 pressure and Chrome reports it as having 1 - this is what makes the lines show up as very thin in Firefox. I'm planning to detect this and set pressure based on pointer velocity at some point in the future, so it's a bit of a glitch for now. I mainly use Chrome on OS X for testing, but I do have acess to a Windows laptop with a N-Trig digitizer that should be fairly close to your Surface Book in behaviour. I've misplaced the pen, which means I can't test that until I get a new one. On my system, using the mouse alone worked, as did using touch to scroll around. I did briefly see behaviour that looked as you described: all input rejected. I'm going to have to wait until I get my replacement pen to be sure but I think it looked like an issue with palm rejection leaving something in a broken state - if that's the case it might also work for you in Chrome if you use only the mouse from the start. One other question - was it the case that only the drawing actions were broken? Ie, could you select tools and click on the buttons in the timeline? |
Hmm? The spec says:
And this matches what I’ve seen every time I’ve dealt with pointer events. It was only drawing actions that were broken. I could interact with other controls successfully. |
No processing is done on the pressure information, so thin lines do indicate that it's either 0 or very low. FlowBetween doesn't just support pointer events, though they are the default. If the browser doesn't support them, FlowBetween will fall back to touch events then to mouse events. There's some debugging you can do to see what events are being generated: firstly, in the console you can run In Safari on OS X: it's definitely using pointer events, and the pressure is definitely not coming out as 0.5 when drawing with the mouse, or a graphics tablet: here's an extract from the raw event:
So I'm thinking it's not compliant with the spec here. Both Firefox and Chrome are properly reporting pressure via pointer events on OS X with a tablet, but Firefox also reports pressure 0 when using a mouse (on OS X and Windows). You can view updates from the server side with |
My replacement pen for my N-trig display has arrived. My suspicion was partially correct: what's happening is the pointer event for painting is starting, continuing for a while and is then being cancelled. It's sometimes possible to see the brush stroke starting, but it seems the browser (or maybe Windows?) decides that it's supposed to scroll the window instead and cancels the previous action. I suspect there's an event I can call My thought was that it starts as a touch event which is then cancelled due to palm rejection, but this sequence happens regardless of if I lay my hand on the screen. I think this might be a change to previous behaviour as I have had this working in Windows in the past. |
I believe the latest version partially fixes this issue: I think I want the canvas to scroll on touch and not draw but this is not the current behaviour. I've done some research and found that some people reported that capturing the touch start event was the way to go to fix this issue. Unfortunately this really only confirms my suspicions that this once worked as this code is already present:
What has changed is that Chrome is no longer supplying |
One last fix: I've stopped painting on touch events (combined with the capture check this makes scrolling on touch work) |
I'm getting the same no-input issue on Chromium on Linux ( with a mouse ). Latest commit off of master: 8bcf2a7. Also when running GTK I can't click any buttons, but I can curiously click the little check-mark on the image history list. Very cool looking tool by the way! 😃 |
The GTK bug has me deeply mystified at the moment: it only happens when the keyboard layout is set to something other than US. Chromium is working for me, though on Linux it doesn't pass through pressure information: it's not impossible that there's still a problem, but it's also possible you've hit another bug, which is that FlowBetween isn't creating a default layer at the moment, which also disables the drawing actions. Clicking the '+' icon above the timeline will add a layer if that's the problem (it's supposed to add a new layer by default but the code to do so got lost in a redesign of the storage subsystem) |
Ah, that worked for Chrome, thanks. :) I really like this idea of an SVG painting and animation tool. It's pretty neat.
Interestingly I have my keyboard set to US, but I did notice an error in the console and it actually can work for just a second before it hits that error and then completely freezes.
|
I just tried this out,
cargo build --release --features http
, and found input broken: I couldn’t draw anything with mouse, touch or pen.Upon adding the CSS
touch-action: none
to the canvas, it worked properly in Chrome (though sadly that stops touch scrolling from working, and there’s currently no solution for this (!), per w3c/pointerevents#203). Firefox still wouldn’t draw with the pen, and drew spindly little lines with the mouse.Windows 10, Surface Book.
The text was updated successfully, but these errors were encountered: