compose-color-picker icon indicating copy to clipboard operation
compose-color-picker copied to clipboard

Animation of movement of coloured circles is stuttering on desktop

Open ChrisAJS opened this issue 3 years ago • 2 comments
trafficstars

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.

ChrisAJS avatar Feb 13 '22 17:02 ChrisAJS

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

ffgiraldez avatar Feb 13 '22 22:02 ffgiraldez

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

riggaroo avatar Feb 14 '22 10:02 riggaroo

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.

ChrisAJS avatar Sep 23 '22 23:09 ChrisAJS

@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

riggaroo avatar Sep 25 '22 18:09 riggaroo

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

ChrisAJS avatar Sep 25 '22 23:09 ChrisAJS