dy static method

double dy(
  1. VAlign align,
  2. double textHeight
)

The dy offset to apply to an origin y so a label of textHeight is anchored.

Implementation

static double dy(VAlign align, double textHeight) {
  switch (align) {
    case VAlign.top:
      return 0;
    case VAlign.center:
      return -textHeight / 2;
    case VAlign.bottom:
      return -textHeight;
  }
}