Commit a2411fa
committed
FIX: clamp get_rotation to [0, 360) when transform_rotates_text
transform_angles can return a tiny-negative value, and in Python
(tiny_negative) % 360 float-rounds to exactly 360.0, breaking the
[0, 360) range that the docstring promises. Clamp 360 back to 0 so
callers can rely on the documented range.
With that in place, the normalize + tolerance wrapper added to
_get_dist_to_box in the previous commit is no longer needed. Reduce
it to plain cardinal-angle short-circuits, per rcomer's suggestion
in #31537.
Rework the transform_rotates_text regression test to compare wrapped
output against a plain rotation=0 reference at the same position,
instead of the weaker "contains a space" assertion.1 parent a8560a9 commit a2411fa
2 files changed
Lines changed: 23 additions & 23 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
778 | 778 | | |
779 | 779 | | |
780 | 780 | | |
781 | | - | |
782 | | - | |
783 | | - | |
784 | | - | |
785 | | - | |
786 | | - | |
| 781 | + | |
| 782 | + | |
787 | 783 | | |
788 | | - | |
789 | | - | |
790 | | - | |
791 | | - | |
792 | | - | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
793 | 789 | | |
794 | | - | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
795 | 797 | | |
796 | 798 | | |
797 | 799 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
339 | 339 | | |
340 | 340 | | |
341 | 341 | | |
342 | | - | |
| 342 | + | |
343 | 343 | | |
| 344 | + | |
| 345 | + | |
344 | 346 | | |
345 | 347 | | |
346 | 348 | | |
| |||
757 | 759 | | |
758 | 760 | | |
759 | 761 | | |
760 | | - | |
761 | | - | |
762 | | - | |
763 | | - | |
764 | | - | |
765 | | - | |
766 | | - | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
767 | 765 | | |
768 | | - | |
| 766 | + | |
769 | 767 | | |
770 | | - | |
| 768 | + | |
771 | 769 | | |
772 | | - | |
| 770 | + | |
773 | 771 | | |
774 | 772 | | |
775 | 773 | | |
| |||
0 commit comments