Limit pixel values further to 16bit integer range (#7848)

This commit is contained in:
Jukka Kurkela 2020-10-05 15:37:12 +03:00 committed by GitHub
parent 8438da9e84
commit 1a9b452cda
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -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, _int32Range} from '../helpers/helpers.math';
import {_factorize, toDegrees, toRadians, _int16Range} 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 _int32Range(me._startPixel + decimal * me._length);
return _int16Range(me._startPixel + decimal * me._length);
}
/**

View File

@ -173,6 +173,6 @@ export function _limitValue(value, min, max) {
return Math.max(min, Math.min(max, value));
}
export function _int32Range(value) {
return _limitValue(value, -2147483648, 2147483647);
export function _int16Range(value) {
return _limitValue(value, -32768, 32767);
}