| 13 | } |
| 14 | |
| 15 | void Label::draw(const DrawArgs& args) { |
| 16 | // TODO |
| 17 | // Custom font sizes do not work with right or center alignment |
| 18 | float x; |
| 19 | switch (alignment) { |
| 20 | default: |
| 21 | case LEFT_ALIGNMENT: { |
| 22 | x = 0.0; |
| 23 | } break; |
| 24 | case RIGHT_ALIGNMENT: { |
| 25 | x = box.size.x - bndLabelWidth(args.vg, -1, text.c_str()); |
| 26 | } break; |
| 27 | case CENTER_ALIGNMENT: { |
| 28 | x = (box.size.x - bndLabelWidth(args.vg, -1, text.c_str())) / 2.0; |
| 29 | } break; |
| 30 | } |
| 31 | |
| 32 | nvgTextLineHeight(args.vg, lineHeight); |
| 33 | NVGcolor colorActual = (color.a > 0.f) ? color : bndGetTheme()->regularTheme.textColor; |
| 34 | bndIconLabelValue(args.vg, x, 0.0, box.size.x, box.size.y, -1, colorActual, BND_LEFT, fontSize, text.c_str(), NULL); |
| 35 | } |
| 36 | |
| 37 | |
| 38 | } // namespace ui |
nothing calls this directly
no outgoing calls
no test coverage detected