Michael Paus
11/30/2020, 2:00 PMjim
11/30/2020, 2:07 PMSiggi Gunnarss
11/30/2020, 2:19 PMinvalidate()
directlyAdam Powell
11/30/2020, 3:09 PMwithFrameNanos
suspend function. Its operation is synchronized to the target framerate of the composition when running in a CoroutineScope
obtained from LaunchedEffect
or rememberCoroutineScope
.Igor Demin
11/30/2020, 5:11 PMCoroutineScope
only obtained from LaunchedEffect
or rememberCoroutineScope
(not hand-created independent CoroutineScope).
Because it contains the local timer (coroutineContext[MonotonicFrameClock]
) for the current display (we can have multiple displays with different refresh rate).
Currently withFrameNanos
timer uses default display's refresh rate, but soon there will be a fix in Compose for Desktop (withFrameNanos
will use the local display timer).Michael Paus
12/01/2020, 8:29 AMwithFrameNanos.
. Which timer will it use if my drawing is on two or more screens at the same time? (Single, multi-screen desktop)(Same problem as with multi-screens with different rendering scales)Igor Demin
12/07/2020, 3:55 PMWhich timer will it use if my drawing is on two or more screens at the same timeIt will use timer with refresh rate of display on which the window is currently running. If we move window to another display - it will use different timer. This is how it will work soon. Now timer uses only default's display refresh rate.