mirror of
https://github.com/chartjs/Chart.js.git
synced 2024-10-06 12:19:08 +02:00
Limit pixel values to 32bit integer range (#7800)
This commit is contained in:
parent
2c5db2c350
commit
17e27e16cc
@ -2,7 +2,7 @@ import defaults from './core.defaults';
|
||||
import Element from './core.element';
|
||||
import {_alignPixel, _measureText} from '../helpers/helpers.canvas';
|
||||
import {callback as call, each, isArray, isFinite, isNullOrUndef, isObject, valueOrDefault} from '../helpers/helpers.core';
|
||||
import {_factorize, toDegrees, toRadians} from '../helpers/helpers.math';
|
||||
import {_factorize, toDegrees, toRadians, _int32Range} from '../helpers/helpers.math';
|
||||
import {toFont, resolve, toPadding} from '../helpers/helpers.options';
|
||||
import Ticks from './core.ticks';
|
||||
|
||||
@ -981,7 +981,7 @@ export default class Scale extends Element {
|
||||
decimal = 1 - decimal;
|
||||
}
|
||||
|
||||
return me._startPixel + decimal * me._length;
|
||||
return _int32Range(me._startPixel + decimal * me._length);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -172,3 +172,7 @@ export function _angleBetween(angle, start, end) {
|
||||
export function _limitValue(value, min, max) {
|
||||
return Math.max(min, Math.min(max, value));
|
||||
}
|
||||
|
||||
export function _int32Range(value) {
|
||||
return _limitValue(value, -2147483648, 2147483647);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user