(barWidth, barHeight, textWidth, textHeight, isHorizontal)
| 732 | } |
| 733 | |
| 734 | function textfitsInsideBar(barWidth, barHeight, textWidth, textHeight, isHorizontal) { |
| 735 | if (barWidth < 0 || barHeight < 0) return false; |
| 736 | var fitsInside = textWidth <= barWidth && textHeight <= barHeight; |
| 737 | var fitsInsideIfRotated = textWidth <= barHeight && textHeight <= barWidth; |
| 738 | var fitsInsideIfShrunk = isHorizontal |
| 739 | ? barWidth >= textWidth * (barHeight / textHeight) |
| 740 | : barHeight >= textHeight * (barWidth / textWidth); |
| 741 | return fitsInside || fitsInsideIfRotated || fitsInsideIfShrunk; |
| 742 | } |
| 743 | |
| 744 | function getRotateFromAngle(angle) { |
| 745 | return angle === 'auto' ? 0 : angle; |
no outgoing calls
no test coverage detected
searching dependent graphs…