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

Ability to place tail tip along cross axis #1

Open
stargazing-dino opened this issue Jun 17, 2021 · 0 comments
Open

Ability to place tail tip along cross axis #1

stargazing-dino opened this issue Jun 17, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@stargazing-dino
Copy link
Owner

stargazing-dino commented Jun 17, 2021

For vertical text boxes like japanese, it'd be cool if you could center the tip along the center vertical axis.

Simulator Screen Shot - iPod touch (7th generation) - 2021-06-17 at 11 25 19

This would involve doing some black magic on cross axis code of vertical|horizontal PositionDependentBox function. Namely, we'd likely pass through an alignment and do it based off that. The code below favors the left margin I think

// HORIZONTAL DIRECTION
  double x;
  if (size.width - margin.horizontal < childSize.width) {
    x = (size.width - childSize.width) / 2.0;
  } else {
    final normalizedTargetX =
        target.dx.clamp(margin.left, size.width - margin.right);
    final edge = margin.left + childSize.width / 2.0;
    if (normalizedTargetX < edge) {
      x = margin.left;
    } else if (normalizedTargetX > size.width - edge) {
      x = size.width - margin.left - childSize.width;
    } else {
      x = normalizedTargetX - childSize.width / 2.0;
    }
  }
@stargazing-dino stargazing-dino added the enhancement New feature or request label Jun 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant