For vertical text boxes like japanese, it'd be cool if you could center the tip along the center vertical axis.
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;
}
}
For vertical text boxes like japanese, it'd be cool if you could center the tip along the center vertical axis.
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