Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

composition problem #115

Open
RAYANaouf opened this issue Jan 26, 2025 · 2 comments
Open

composition problem #115

RAYANaouf opened this issue Jan 26, 2025 · 2 comments

Comments

@RAYANaouf
Copy link

  • latest Version
  • Affected Device : Samsung Galaxy s20

Describe the Bug:

when a recomposition hapens the value of color return to the init one and the circle return back to the center of the image.

@skydoves
Copy link
Owner

Hi @RAYANaouf, would you able to describe the details with the code example? Thank you!

@RAYANaouf
Copy link
Author

look my friend ,see that :
var selectedColor by remember {
mutableStateOf(Color.Transparent)
}
// Image Color Picker
ImageColorPicker(
controller = controller,
paletteImageBitmap = bitmap.asImageBitmap(),
onColorChanged = { colorEnvelope: ColorEnvelope ->
controller.wheelColor = colorEnvelope.color
selectedColor = colorEnvelope.color
},
paletteContentScale = PaletteContentScale.CROP,
modifier = Modifier
.fillMaxWidth()
.height(350.dp)
.clip(RoundedCornerShape(16.dp))
.border(
width = 2.dp,
color = p_color1,
shape = RoundedCornerShape(16.dp)
)
)

            Spacer(modifier = Modifier.height(26.dp))

            Box(modifier = Modifier.background(selectedColor).size(35.dp))

the change on the color triger the recomposition then the box will change its background then the colorPickerDialog will reset its circle position to center of the image , i change the circle position then repeatedly get back to the center.

to better understand : when i comment that line ==> //selectedColor = colorEnvelope.color

the dialog work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants