From e07fece29e5dcf615ed9f967702715e0299c8a9e Mon Sep 17 00:00:00 2001 From: Zach Bjornson Date: Wed, 1 Nov 2017 15:44:34 -0700 Subject: [PATCH 1/2] Fix typo in example --- examples/image-src.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/image-src.js b/examples/image-src.js index 8d10aec58..49d7901b2 100644 --- a/examples/image-src.js +++ b/examples/image-src.js @@ -1,5 +1,5 @@ var fs = require('fs') -var path = require(path) +var path = require('path') var Canvas = require('..') var Image = Canvas.Image From 72f949aba90ea59cac3b2f6e47d057c43a460140 Mon Sep 17 00:00:00 2001 From: Zach Bjornson Date: Wed, 1 Nov 2017 15:49:00 -0700 Subject: [PATCH 2/2] Fix require statement for currentTransform --- lib/context2d.js | 2 +- test/canvas.test.js | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/lib/context2d.js b/lib/context2d.js index da7384a82..7174355fc 100644 --- a/lib/context2d.js +++ b/lib/context2d.js @@ -16,7 +16,7 @@ const Context2d = module.exports = bindings.CanvasRenderingContext2d const CanvasGradient = bindings.CanvasGradient const CanvasPattern = bindings.CanvasPattern const ImageData = bindings.ImageData -const DOMMatrix = require('./DOMMatrix') +const DOMMatrix = require('./DOMMatrix').DOMMatrix /** * Text baselines. diff --git a/test/canvas.test.js b/test/canvas.test.js index 2b2fc58f8..f3fb3ddfe 100644 --- a/test/canvas.test.js +++ b/test/canvas.test.js @@ -799,6 +799,20 @@ describe('Canvas', function () { }); }); + it('Context2d#currentTransform', function () { + var canvas = createCanvas(20, 20); + var ctx = canvas.getContext('2d'); + + ctx.scale(0.1, 0.3); + var actual = ctx.currentTransform; + assert.equal(actual.a, 0.1); + assert.equal(actual.b, 0); + assert.equal(actual.c, 0); + assert.equal(actual.d, 0.3); + assert.equal(actual.e, 0); + assert.equal(actual.f, 0); + }); + it('Context2d#createImageData(ImageData)', function () { var canvas = createCanvas(20, 20) , ctx = canvas.getContext('2d');