You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
That uses the instant at which the controller is called for the pointer controller to calculate the time of the event (or more precisely, gives the timestamp for the latest event of that gdk::Event).
But this creates erroneous times. Debugging what's given by #1235, we get the following
What we're concerned about is the delta position and delta time between two events (and the ratio of the two, in the last column). This is with the BacklogPolicy::NoLimit option. And we see we get events with a non zero position difference and a zero time delta (not just close to zero, EXACTLY 0).
Looking at the raw event data, the first three events are here :
RawEvent(
x=[227.7329226372115],
y=[101.22599202560606],
event_type='other',
time_str=['Instant { t: 1383023.4689412s }'],
gtk_time=[1382966381]
)
RawEvent(
x=[227.7329226372115],
y=[101.22599202560606],
event_type='ButtonPress', // the button Press Event
time_str=['Instant { t: 1383023.4704186s }'],
gtk_time=[1382966381] // for gtk, this is sent at exactly the same position as the previous location with the SAME time
)
RawEvent(
x=[223.59197575860676, 221.3217951414422, 218.5261142707021],
y=[101.91967188204403, 102.31904963454664, 102.84456208919609],
event_type='other',
time_str=['Instant { t: 1383023.4703054s }', 'Instant { t: 1383023.4743054s }', 'Instant { t: 1383023.4783054s }'],
// for rnote, the first event is at 1383023.4703054s which is EARLIER than the previous event
// at 1383023.4704186s
gtk_time=[1382966388, 1382966392, 1382966396] // the first event is 7 ms after the last one
)
So we get later events placed before previous events, when there is a non-empty history. This is why we get exactly 0.0 as the difference of instants ((time - last_element_time).as_secs_f64() saturates to 0 if the difference is negative).
So we should add somewhere (in the canvas/ui code ?) a mapping between Instant and gtk's u32 time stamping (maybe set this on the first event with a time stamp. so we have a Instant::now corresponding to a u32 value and do other calculations relative to this to still keep std::Instant lower in the engine code).
I don't know whether there is other precaution to take regarding gtk4's time (does it overflow ? I mean it'll take a while for that to happen, 50 days from my napkin math, but if it increases with the system clock and not screen time, it's possible to have this issue on tablets that are never shut down with rnote staying open)
This is an issue because we rely on correct timings for the ink stroke modeler and the upcoming eraser PR (increase size with speed).
There's a little bit of observer effect (timing changes from logging this), though I had the same issue without logging (infinite speed upon touching the screen). I guess this issue only really manifest if the gtk event history is not empty, so only for pen that refresh more quickly than the display.
Without the BacklogPolicy changed, and logging only the eraser data, I get a delta time between the ButtonPress and the next event in the 6e-5 s.
The text was updated successfully, but these errors were encountered:
In the input file, there is this line
rnote/crates/rnote-ui/src/canvas/input.rs
Line 21 in 7f3ff8a
That uses the instant at which the controller is called for the pointer controller to calculate the time of the event (or more precisely, gives the timestamp for the latest event of that
gdk::Event
).But this creates erroneous times. Debugging what's given by #1235, we get the following
What we're concerned about is the delta position and delta time between two events (and the ratio of the two, in the last column). This is with the
BacklogPolicy::NoLimit
option. And we see we get events with a non zero position difference and a zero time delta (not just close to zero, EXACTLY 0).Looking at the raw event data, the first three events are here :
So we get later events placed before previous events, when there is a non-empty history. This is why we get exactly 0.0 as the difference of instants (
(time - last_element_time).as_secs_f64()
saturates to 0 if the difference is negative).So we should add somewhere (in the canvas/ui code ?) a mapping between
Instant
and gtk's u32 time stamping (maybe set this on the first event with a time stamp. so we have aInstant::now
corresponding to au32
value and do other calculations relative to this to still keepstd::Instant
lower in the engine code).I don't know whether there is other precaution to take regarding gtk4's time (does it overflow ? I mean it'll take a while for that to happen, 50 days from my napkin math, but if it increases with the system clock and not screen time, it's possible to have this issue on tablets that are never shut down with rnote staying open)
This is an issue because we rely on correct timings for the ink stroke modeler and the upcoming eraser PR (increase size with speed).
There's a little bit of observer effect (timing changes from logging this), though I had the same issue without logging (infinite speed upon touching the screen). I guess this issue only really manifest if the gtk event history is not empty, so only for pen that refresh more quickly than the display.
Without the
BacklogPolicy
changed, and logging only the eraser data, I get a delta time between theButtonPress
and the next event in the 6e-5 s.The text was updated successfully, but these errors were encountered: