getMargin function

double getMargin(
  1. AnchorMargin margin,
  2. double distance
)

Implementation

double getMargin(AnchorMargin margin, double distance) {
  if (margin == AnchorMargin.none) return 0;
  return margin == AnchorMargin.start ? -distance : distance;
}