positionTip method

void positionTip({
  1. required ArrowTip tip,
  2. required TipSide side,
})

Implementation

void positionTip({required ArrowTip tip, required TipSide side}) {
  var anchor = side == TIP_AT_START ? getStart() : getEnd();
  var handle = side == TIP_AT_START ? getFirstHandle() : getLastHandle();

  tip.rotate(-(handle - anchor).angle() - tip.getAngle() - PI);
  tip.shift(anchor - tip.getTipPoint());
}