I don't suppose any rockstars in here would unders...
# compose-desktop
c
I don't suppose any rockstars in here would understand why on Mac OS the colour wheel animates flawlessly, but on Ubuntu, the animation is choppy? Like any known caveats? https://github.com/godaddy/compose-color-picker/issues/19
r
Use a profiler like VisualVM to see where time is spent
c
I can give it a shot, but I just don't understand how the colours in the orbs can continue updating and why only slow mouse movements result in a kind of animation, though not as smooth as observed on Mac OS
r
Can you try to remove the animation for positionAnimated to see if it's the cause? As I don't think the colours are animating the change.
c
@Rebecca Franks let me give that a go
I did some old fashioned printf'ing and found that the position value is updating, but the positionAnimated value is not. My compose-fu is only weak, so I don't know how compose handles scheduling animations to occur, but wonder if the potentially massive influx of events (from dragging) is leading to some sort of pending animation queue getting filled faster than it can be emptied. This would explain why moving the mouse slowly does result in animation at least. If only someone on this particular slack thread had intimate knowledge of animations and compose 😞
r
I'll take a deeper look at it this week to see if I can figure out whats going wrong 🙂
c
This is what I added - I noticed that position.x and y update as expected, but the positionAnimated do not.
Copy code
val positionAnimated by animateOffsetAsState(
        targetValue = position,
        animationSpec = spring(dampingRatio = Spring.DampingRatioLowBouncy)
    )
    println("HIT ${position} ${positionAnimated.x} ${positionAnimated.y}")
I was trying to goad Romain into looking 😛, because unless the api is being used incorrectly (doesn't look like it!) then it sounds like a framework thing :X
but the library is immense, great job on it! 🤜 💥 🤛
r
The strange part is that I haven't seen this issue on Android or Mac
It probably shouldn't be calling the animation on drag, and rather snapping to the new value on drag, and only animating on touch.
c
I think that's a really tidy solution, I'll be happy to test!