godaddy / compose-color-picker

Jetpack Compose Android Color Picker 🎨
MIT License
369 stars 23 forks source link

Animation of movement of coloured circles is stuttering on desktop #19

Closed ChrisAJS closed 1 year ago

ChrisAJS commented 2 years ago

Some details: OS: Linux Version: 0.4.2 Kotlin: 1.5.31 Jetpack Compose Desktop: 1.0.0

The issue is that the location of the coloured circles will only update sporadically (always updating to the correct position on release of the mouse button).

Interestingly, the colour contained within the circles continues to update as you move the cursor around the colour circle.

My usage is as follows:

HarmonyColorPicker(
harmonyMode = harmonyMode.value,
modifier = Modifier.size(400.dp),
onColorChanged = { hsvColor ->
   currentColor = hsvColor.toColor()
   extraColours.clear()
   extraColors.addAll(hsvColor.getColors(colorHarmonyMode = harmonyMode.value))
})

The library is incredible! Happy to test further or provide a video demo.

ffgiraldez commented 2 years ago

Yeah, a video should be great. I guess something related to how desktop manage clicks compared to mobile

riggaroo commented 2 years ago

A video would definitely help! I'm not seeing it on my mac with the sample app. Have you tried checking out this sample code base and running ./gradlew desktop:run ?

https://user-images.githubusercontent.com/9973046/153843824-e3c53055-fd13-4b66-9766-7b40e2dd82a7.mov

ChrisAJS commented 1 year ago

Hello! Long time no speak (terribly sorry!)

Please find attached a video demonstrating the issue:

https://user-images.githubusercontent.com/4558817/192070048-e6d9d0d9-4f48-4916-87a3-755a5122a1f1.mp4

This was using the current source code as it stands in main.

As you can see, minor movements does result in animation of sorts (not as smooth as the video from Mac OS), but quick movements see the colour indicators lock in place, as the colour inside them miraculously and fluidly animates.

riggaroo commented 1 year ago

@ChrisAJS Can you try this branch and let me know if it fixes the issue for you? https://github.com/godaddy/compose-color-picker/tree/bugfix/stuttering-linux

ChrisAJS commented 1 year ago

The branch seems to do the job perfectly!

This is what the experience looks like now:

https://user-images.githubusercontent.com/4558817/192169574-410e243c-77fd-4d07-9c31-82bbf54ff6e5.mp4