(textRect, rotate)
| 37941 | } |
| 37942 | |
| 37943 | function rotateTextRect(textRect, rotate) { |
| 37944 | var rotateRadians = rotate * Math.PI / 180; |
| 37945 | var boundingBox = textRect.plain(); |
| 37946 | var beforeWidth = boundingBox.width; |
| 37947 | var beforeHeight = boundingBox.height; |
| 37948 | var afterWidth = beforeWidth * Math.abs(Math.cos(rotateRadians)) + Math.abs(beforeHeight * Math.sin(rotateRadians)); |
| 37949 | var afterHeight = beforeWidth * Math.abs(Math.sin(rotateRadians)) + Math.abs(beforeHeight * Math.cos(rotateRadians)); |
| 37950 | var rotatedRect = new BoundingRect(boundingBox.x, boundingBox.y, afterWidth, afterHeight); |
| 37951 | |
| 37952 | return rotatedRect; |
| 37953 | } |
| 37954 | |
| 37955 | /** |
| 37956 | * @param {module:echarts/src/model/Model} model axisLabelModel or axisTickModel |
no test coverage detected