(textBB, r, ring, halfAngle, midAngle)
| 813 | } |
| 814 | |
| 815 | function calcTanTransform(textBB, r, ring, halfAngle, midAngle) { |
| 816 | r = Math.max(0, r - 2 * TEXTPAD); |
| 817 | |
| 818 | // max size if text is rotated tangentially |
| 819 | var a = textBB.height / textBB.width; |
| 820 | var s = calcMaxHalfSize(a, halfAngle, r, ring); |
| 821 | return { |
| 822 | scale: (s * 2) / textBB.width, |
| 823 | rCenter: calcRCenter(a, s / r), |
| 824 | rotate: calcRotate(midAngle + Math.PI / 2) |
| 825 | }; |
| 826 | } |
| 827 | |
| 828 | function calcRCenter(a, b) { |
| 829 | return Math.cos(b) - a * b; |
no test coverage detected
searching dependent graphs…