Avoid unexpected behavior when passing string coordinates

This commit is contained in:
ahocevar
2018-12-12 22:30:58 +01:00
parent e426af29c2
commit 80ebb8142c
4 changed files with 17 additions and 3 deletions

View File

@@ -40,8 +40,8 @@ import {padNumber} from './string.js';
* @api
*/
export function add(coordinate, delta) {
coordinate[0] += delta[0];
coordinate[1] += delta[1];
coordinate[0] += +delta[0];
coordinate[1] += +delta[1];
return coordinate;
}