mirror of
https://github.com/chartjs/Chart.js.git
synced 2025-12-08 20:36:08 +00:00
Limit Math.asin inputs to the range [-1, 1] (#9410)
This commit is contained in:
parent
58999ea7ac
commit
df49447867
@ -593,8 +593,8 @@ export default class Scale extends Element {
|
||||
- tickOpts.padding - getTitleHeight(options.title, me.chart.options.font);
|
||||
maxLabelDiagonal = Math.sqrt(maxLabelWidth * maxLabelWidth + maxLabelHeight * maxLabelHeight);
|
||||
labelRotation = toDegrees(Math.min(
|
||||
Math.asin(Math.min((labelSizes.highest.height + 6) / tickWidth, 1)),
|
||||
Math.asin(Math.min(maxHeight / maxLabelDiagonal, 1)) - Math.asin(maxLabelHeight / maxLabelDiagonal)
|
||||
Math.asin(_limitValue((labelSizes.highest.height + 6) / tickWidth, -1, 1)),
|
||||
Math.asin(_limitValue(maxHeight / maxLabelDiagonal, -1, 1)) - Math.asin(_limitValue(maxLabelHeight / maxLabelDiagonal, -1, 1))
|
||||
));
|
||||
labelRotation = Math.max(minRotation, Math.min(maxRotation, labelRotation));
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user