Skip to content

Commit 7080079

Browse files
committed
Merge pull request #179 from CartoDB/clamped
Changes value array type to UInt8ClampedArray
2 parents 58345d2 + a27960f commit 7080079

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

lib/torque/core.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@
6161
// types
6262
var types = {
6363
Uint8Array: typeof(global['Uint8Array']) !== 'undefined' ? global.Uint8Array : Array,
64+
Uint8ClampedArray: typeof(global['Uint8ClampedArray']) !== 'undefined' ? global.Uint8ClampedArray: Array,
6465
Uint32Array: typeof(global['Uint32Array']) !== 'undefined' ? global.Uint32Array : Array,
6566
Int16Array: typeof(global['Int16Array']) !== 'undefined' ? global.Int16Array : Array,
6667
Int32Array: typeof(global['Int32Array']) !== 'undefined' ? global.Int32Array: Array

lib/torque/provider/windshaft.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
var Uint8Array = torque.types.Uint8Array;
55
var Int32Array = torque.types.Int32Array;
66
var Uint32Array = torque.types.Uint32Array;
7+
var Uint8ClampedArray = torque.types.Uint8ClampedArray;
78

89
// format('hello, {0}', 'rambo') -> "hello, rambo"
910
function format(str) {
@@ -82,7 +83,7 @@
8283
dates = (1 + maxDateSlots) * rows.length;
8384
}
8485

85-
var type = this.options.cumulative ? Uint32Array: Uint8Array;
86+
var type = this.options.cumulative ? Uint32Array: Uint8ClampedArray;
8687

8788
// reserve memory for all the dates
8889
var timeIndex = new Int32Array(maxDateSlots + 1); //index-size

0 commit comments

Comments
 (0)