diff options
author | Freeyorp <TheFreeYorp@NOSPAM.G.m.a.i.l.replace> | 2013-06-26 02:58:35 +1200 |
---|---|---|
committer | Freeyorp <TheFreeYorp@NOSPAM.G.m.a.i.l.replace> | 2013-06-26 02:58:35 +1200 |
commit | da89573679309ad3c8ed11b93a806ea6384ba6fb (patch) | |
tree | 8b68ef02da4b8b1742e9c7ff49e1698f96e9edde /test/load.js | |
parent | 2cf8ba330dc60fa4c269c4fdb16716a1d9ad1e90 (diff) | |
download | manaportal-da89573679309ad3c8ed11b93a806ea6384ba6fb.tar.gz manaportal-da89573679309ad3c8ed11b93a806ea6384ba6fb.tar.bz2 manaportal-da89573679309ad3c8ed11b93a806ea6384ba6fb.tar.xz manaportal-da89573679309ad3c8ed11b93a806ea6384ba6fb.zip |
Implement dyeImage
Split loadImage into a common resource.js
Add a compatability check for both canvas-node and browser functionality
Note that the generated dyed image is off-by-one to the tested TMWW image.
The algorithm needs verification and possibly correction.
Either way, it's close enough by the eye.
Diffstat (limited to 'test/load.js')
-rw-r--r-- | test/load.js | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/test/load.js b/test/load.js index 97bee69..57e838e 100644 --- a/test/load.js +++ b/test/load.js @@ -2,7 +2,8 @@ process.env.TZ = "UTC"; var smash = require("smash"), - jsdom = require("jsdom"); + jsdom = require("jsdom"), + Canvas = require("canvas"); module.exports = function() { var files = [].slice.call(arguments).map(function(d) { return "public/js/" + d; }), @@ -40,10 +41,16 @@ module.exports = function() { }; }; + document.createCanvas = function() { + return new Canvas(); + } + sandbox = { console: console, document: document, window: document.createWindow(), + Canvas: Canvas, + Image: Canvas.Image }; return topic; |