| 344 | /************************************* vertical box implementation ********************************/ |
| 345 | |
| 346 | VerticalBox::VerticalBox(const sptr<Box>& b, float rest, int alignment) |
| 347 | : _leftMostPos(F_MAX), _rightMostPos(F_MIN) { |
| 348 | add(b); |
| 349 | if (alignment == ALIGN_CENTER) { |
| 350 | sptr<Box> s(new StrutBox(0, rest / 2, 0, 0)); |
| 351 | Box::add(0, s); |
| 352 | _height += rest / 2.f; |
| 353 | _depth += rest / 2.f; |
| 354 | Box::add(s); |
| 355 | } else if (alignment == ALIGN_TOP) { |
| 356 | _depth += rest; |
| 357 | sptr<Box> s(new StrutBox(0, rest, 0, 0)); |
| 358 | Box::add(s); |
| 359 | } else if (alignment == ALIGN_BOTTOM) { |
| 360 | _height += rest; |
| 361 | sptr<Box> s(new StrutBox(0, rest, 0, 0)); |
| 362 | Box::add(0, s); |
| 363 | } |
| 364 | } |
| 365 | |
| 366 | void VerticalBox::recalculateWidth(const Box& b) { |
| 367 | _leftMostPos = min(_leftMostPos, b._shift); |
nothing calls this directly
no outgoing calls
no test coverage detected