(limits, orig, angle, hLimits, vLimits)
| 116 | } |
| 117 | |
| 118 | function updateLimits(limits, orig, angle, hLimits, vLimits) { |
| 119 | const sin = Math.abs(Math.sin(angle)); |
| 120 | const cos = Math.abs(Math.cos(angle)); |
| 121 | let x = 0; |
| 122 | let y = 0; |
| 123 | if (hLimits.start < orig.l) { |
| 124 | x = (orig.l - hLimits.start) / sin; |
| 125 | limits.l = Math.min(limits.l, orig.l - x); |
| 126 | } else if (hLimits.end > orig.r) { |
| 127 | x = (hLimits.end - orig.r) / sin; |
| 128 | limits.r = Math.max(limits.r, orig.r + x); |
| 129 | } |
| 130 | if (vLimits.start < orig.t) { |
| 131 | y = (orig.t - vLimits.start) / cos; |
| 132 | limits.t = Math.min(limits.t, orig.t - y); |
| 133 | } else if (vLimits.end > orig.b) { |
| 134 | y = (vLimits.end - orig.b) / cos; |
| 135 | limits.b = Math.max(limits.b, orig.b + y); |
| 136 | } |
| 137 | } |
| 138 | |
| 139 | function createPointLabelItem(scale, index, itemOpts) { |
| 140 | const outerDistance = scale.drawingArea; |
no outgoing calls
no test coverage detected