Balloon icon indicating copy to clipboard operation
Balloon copied to clipboard

Compose: arrow position is wrong

Open alexanderfilipzik opened this issue 2 years ago • 2 comments

Please complete the following information:

  • v1.6.1
  • all? maybe related to https://github.com/skydoves/Balloon/issues/413

Describe the Bug:

The arrow is not correctly pointing to the middle of anchor.

Expected Behavior:

The arrow is correctly pointing to the middle of anchor.

      val builder = rememberBalloonBuilder {
        setArrowPositionRules(ArrowPositionRules.ALIGN_ANCHOR)
        setArrowPosition(0.5f)
        setMarginHorizontal(12)
      }

      var balloonWindow1: BalloonWindow? by remember { mutableStateOf(null) }

      Column {
        Spacer(modifier = Modifier.height(300.dp))
        Box(
          modifier = Modifier
            .padding(horizontal = 12.dp) // changing this to a larger value like 36.dp will work for the arrow
        ) {
          Balloon(
            builder = builder,
            balloonContent = {
              Text(
                modifier = Modifier.fillMaxWidth(),
                text = "Now you can edit your profile1 profile2 profile3 profile4",
                color = Color.White,
              )
            },
          ) { balloonWindow ->
            LaunchedEffect(key1 = Unit) {
              balloonWindow1 = balloonWindow
            }

            Button(
              modifier = Modifier


                .padding(horizontal = 0.dp)
                .size(48.dp, 48.dp),
              onClick = { balloonWindow1?.showAlignTop(yOff = 20) },
            ) {
              Text(text = "|")
            }
          }
        }
      }

12.dp: Bildschirmfoto 2023-10-19 um 09 54 24

36.dp: Bildschirmfoto 2023-10-19 um 09 54 40

alexanderfilipzik avatar Oct 19 '23 07:10 alexanderfilipzik

heyho @skydoves :) do you have any news on that - the impact is huge if you have more padding in the inside and have larger text and other content on the screen. Happens more often than you expect

alexanderfilipzik avatar Nov 23 '23 08:11 alexanderfilipzik

Hery @alexanderfilipzik, sorry for the delayed response. A new version 1.6.4 has been released, and I'm wondering if this issue still happens in that version.

skydoves avatar Dec 27 '23 21:12 skydoves