------------------------------------------------------------------------------
| 498 | |
| 499 | //------------------------------------------------------------------------------ |
| 500 | void vtkMatplotlibMathTextUtilities::GetJustifiedBBox( |
| 501 | int rows, int cols, vtkTextProperty* tprop, int bbox[4]) |
| 502 | { |
| 503 | bbox[0] = 0; |
| 504 | bbox[1] = cols - 1; |
| 505 | bbox[2] = 0; |
| 506 | bbox[3] = rows - 1; |
| 507 | |
| 508 | int justifyOffset[2]; |
| 509 | switch (tprop->GetJustification()) |
| 510 | { |
| 511 | default: |
| 512 | case VTK_TEXT_LEFT: |
| 513 | justifyOffset[0] = 0; |
| 514 | break; |
| 515 | case VTK_TEXT_CENTERED: |
| 516 | justifyOffset[0] = bbox[1] / 2; |
| 517 | break; |
| 518 | case VTK_TEXT_RIGHT: |
| 519 | justifyOffset[0] = bbox[1]; |
| 520 | break; |
| 521 | } |
| 522 | switch (tprop->GetVerticalJustification()) |
| 523 | { |
| 524 | default: |
| 525 | case VTK_TEXT_BOTTOM: |
| 526 | justifyOffset[1] = 0; |
| 527 | break; |
| 528 | case VTK_TEXT_CENTERED: |
| 529 | justifyOffset[1] = bbox[3] / 2; |
| 530 | break; |
| 531 | case VTK_TEXT_TOP: |
| 532 | justifyOffset[1] = bbox[3]; |
| 533 | break; |
| 534 | } |
| 535 | |
| 536 | bbox[0] -= justifyOffset[0]; |
| 537 | bbox[1] -= justifyOffset[0]; |
| 538 | bbox[2] -= justifyOffset[1]; |
| 539 | bbox[3] -= justifyOffset[1]; |
| 540 | } |
| 541 | |
| 542 | //------------------------------------------------------------------------------ |
| 543 | void vtkMatplotlibMathTextUtilities::RotateCorners( |
no outgoing calls
no test coverage detected