drawingBuffer.js 308 Bytes
Newer Older
Athanasios's avatar
Athanasios committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
class DrawingBuffer {

  constructor(width, height) {
    this.width = width;
    this.height = height;
  }

}

const fromString = (str) => {
  let tokens = str.split(",");
  return new DrawingBuffer(...tokens.map(token => parseFloat(token)));
}

module.exports = { DrawingBuffer, fromString };