dx static method
The dx offset to apply to an origin x so a label of textWidth is anchored.
Implementation
static double dx(HAlign align, double textWidth) {
switch (align) {
case HAlign.start:
return 0;
case HAlign.center:
return -textWidth / 2;
case HAlign.end:
return -textWidth;
}
}