Answers point `p` according to the alignment status in the css. TODO: handle other text alignments.
(self, p)
| 4683 | # Private alignment, scale and rotation functions. |
| 4684 | |
| 4685 | def _applyAlignment(self, p): |
| 4686 | """Answers point `p` according to the alignment status in the css. |
| 4687 | |
| 4688 | TODO: handle other text alignments. |
| 4689 | """ |
| 4690 | px, py, pz = point3D(p) |
| 4691 | |
| 4692 | # Horizontal. |
| 4693 | xAlign = self.xAlign |
| 4694 | |
| 4695 | if xAlign == CENTER: |
| 4696 | px -= self.w / 2 / self.scaleX |
| 4697 | elif xAlign == RIGHT: |
| 4698 | px -= self.w / self.scaleX |
| 4699 | |
| 4700 | # Vertical. |
| 4701 | yAlign = self.yAlign |
| 4702 | |
| 4703 | if yAlign == MIDDLE: |
| 4704 | py -= self.h / 2 / self.scaleY |
| 4705 | elif yAlign == TOP: |
| 4706 | py -= self.h / self.scaleY |
| 4707 | |
| 4708 | # Currently no alignment in z-axis implemented |
| 4709 | return px, py, pz |
| 4710 | |
| 4711 | def _applyRotation(self, view, p): |
| 4712 | """Apply the rotation for angle, where (mx, my) is the rotation center.""" |
no test coverage detected