diff --git a/.travis.yml b/.travis.yml index 70cd6d5..1c60690 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,10 +8,16 @@ - dev install: - - npm install -g grunt-cli - - export DISPLAY=:99.0 - - sh -e /etc/init.d/xvfb start + - npm install grunt-cli - npm install +cache: + directories: + - node_modules + +before_script: + - export DISPLAY=:99.0 + - sh -e /etc/init.d/xvfb start + script: - - grunt travis \ No newline at end of file + - ./node_modules/.bin/grunt travis \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index 70cd6d5..1c60690 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,10 +8,16 @@ - dev install: - - npm install -g grunt-cli - - export DISPLAY=:99.0 - - sh -e /etc/init.d/xvfb start + - npm install grunt-cli - npm install +cache: + directories: + - node_modules + +before_script: + - export DISPLAY=:99.0 + - sh -e /etc/init.d/xvfb start + script: - - grunt travis \ No newline at end of file + - ./node_modules/.bin/grunt travis \ No newline at end of file diff --git a/Gruntfile.js b/Gruntfile.js index 8f53bd3..8bf07c2 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -103,7 +103,8 @@ }, files: { srcBlob: '<%= dirs.src %>/**/*.js', - testBlob: '<%= dirs.test %>/{functional,lib/pixi,unit/pixi}/**/*.js', + testBlob: '<%= dirs.test %>/**/*.js', + testConf: '<%= dirs.test %>/karma.conf.js', build: '<%= dirs.build %>/pixi.dev.js', buildMin: '<%= dirs.build %>/pixi.js' }, @@ -131,10 +132,16 @@ options: { jshintrc: './.jshintrc' }, - source: srcFiles.filter(function(v) { return v.match(/(Intro|Outro|Spine|Pixi)\.js$/) === null; }).concat('Gruntfile.js'), + source: { + src: srcFiles.concat('Gruntfile.js'), + options: { + ignores: '<%= dirs.src %>/**/{Intro,Outro,Spine,Pixi}.js' + } + }, test: { src: ['<%= files.testBlob %>'], options: { + ignores: '<%= dirs.test %>/lib/resemble.js', jshintrc: undefined, //don't use jshintrc for tests expr: true, undef: false, @@ -184,7 +191,7 @@ }, karma: { unit: { - configFile: 'test/karma.conf.js', + configFile: '<%= files.testConf %>', // browsers: ['Chrome'], singleRun: true } diff --git a/.travis.yml b/.travis.yml index 70cd6d5..1c60690 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,10 +8,16 @@ - dev install: - - npm install -g grunt-cli - - export DISPLAY=:99.0 - - sh -e /etc/init.d/xvfb start + - npm install grunt-cli - npm install +cache: + directories: + - node_modules + +before_script: + - export DISPLAY=:99.0 + - sh -e /etc/init.d/xvfb start + script: - - grunt travis \ No newline at end of file + - ./node_modules/.bin/grunt travis \ No newline at end of file diff --git a/Gruntfile.js b/Gruntfile.js index 8f53bd3..8bf07c2 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -103,7 +103,8 @@ }, files: { srcBlob: '<%= dirs.src %>/**/*.js', - testBlob: '<%= dirs.test %>/{functional,lib/pixi,unit/pixi}/**/*.js', + testBlob: '<%= dirs.test %>/**/*.js', + testConf: '<%= dirs.test %>/karma.conf.js', build: '<%= dirs.build %>/pixi.dev.js', buildMin: '<%= dirs.build %>/pixi.js' }, @@ -131,10 +132,16 @@ options: { jshintrc: './.jshintrc' }, - source: srcFiles.filter(function(v) { return v.match(/(Intro|Outro|Spine|Pixi)\.js$/) === null; }).concat('Gruntfile.js'), + source: { + src: srcFiles.concat('Gruntfile.js'), + options: { + ignores: '<%= dirs.src %>/**/{Intro,Outro,Spine,Pixi}.js' + } + }, test: { src: ['<%= files.testBlob %>'], options: { + ignores: '<%= dirs.test %>/lib/resemble.js', jshintrc: undefined, //don't use jshintrc for tests expr: true, undef: false, @@ -184,7 +191,7 @@ }, karma: { unit: { - configFile: 'test/karma.conf.js', + configFile: '<%= files.testConf %>', // browsers: ['Chrome'], singleRun: true } diff --git a/README.md b/README.md index 7806d6c..1258485 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,8 @@ ### Demos ### +- [WebGL Filters!]() + - [Run pixi run]() - [Fight for Everyone]() @@ -150,3 +152,5 @@ ``` This content is released under the (http://opensource.org/licenses/MIT) MIT License. + +[![Analytics](https://ga-beacon.appspot.com/UA-39213431-2/pixi.js/index)](https://github.com/igrigorik/ga-beacon) diff --git a/.travis.yml b/.travis.yml index 70cd6d5..1c60690 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,10 +8,16 @@ - dev install: - - npm install -g grunt-cli - - export DISPLAY=:99.0 - - sh -e /etc/init.d/xvfb start + - npm install grunt-cli - npm install +cache: + directories: + - node_modules + +before_script: + - export DISPLAY=:99.0 + - sh -e /etc/init.d/xvfb start + script: - - grunt travis \ No newline at end of file + - ./node_modules/.bin/grunt travis \ No newline at end of file diff --git a/Gruntfile.js b/Gruntfile.js index 8f53bd3..8bf07c2 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -103,7 +103,8 @@ }, files: { srcBlob: '<%= dirs.src %>/**/*.js', - testBlob: '<%= dirs.test %>/{functional,lib/pixi,unit/pixi}/**/*.js', + testBlob: '<%= dirs.test %>/**/*.js', + testConf: '<%= dirs.test %>/karma.conf.js', build: '<%= dirs.build %>/pixi.dev.js', buildMin: '<%= dirs.build %>/pixi.js' }, @@ -131,10 +132,16 @@ options: { jshintrc: './.jshintrc' }, - source: srcFiles.filter(function(v) { return v.match(/(Intro|Outro|Spine|Pixi)\.js$/) === null; }).concat('Gruntfile.js'), + source: { + src: srcFiles.concat('Gruntfile.js'), + options: { + ignores: '<%= dirs.src %>/**/{Intro,Outro,Spine,Pixi}.js' + } + }, test: { src: ['<%= files.testBlob %>'], options: { + ignores: '<%= dirs.test %>/lib/resemble.js', jshintrc: undefined, //don't use jshintrc for tests expr: true, undef: false, @@ -184,7 +191,7 @@ }, karma: { unit: { - configFile: 'test/karma.conf.js', + configFile: '<%= files.testConf %>', // browsers: ['Chrome'], singleRun: true } diff --git a/README.md b/README.md index 7806d6c..1258485 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,8 @@ ### Demos ### +- [WebGL Filters!]() + - [Run pixi run]() - [Fight for Everyone]() @@ -150,3 +152,5 @@ ``` This content is released under the (http://opensource.org/licenses/MIT) MIT License. + +[![Analytics](https://ga-beacon.appspot.com/UA-39213431-2/pixi.js/index)](https://github.com/igrigorik/ga-beacon) diff --git a/bower.json b/bower.json index c1ecdb6..a8b9375 100644 --- a/bower.json +++ b/bower.json @@ -1,11 +1,11 @@ { "name": "pixi.js", - "version": "1.4.0", + "version": "1.4.1", "main": "bin/pixi.js", "ignore": [ - "**/.*" + "**/.*", "node_modules", "bower_components", "test" diff --git a/.travis.yml b/.travis.yml index 70cd6d5..1c60690 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,10 +8,16 @@ - dev install: - - npm install -g grunt-cli - - export DISPLAY=:99.0 - - sh -e /etc/init.d/xvfb start + - npm install grunt-cli - npm install +cache: + directories: + - node_modules + +before_script: + - export DISPLAY=:99.0 + - sh -e /etc/init.d/xvfb start + script: - - grunt travis \ No newline at end of file + - ./node_modules/.bin/grunt travis \ No newline at end of file diff --git a/Gruntfile.js b/Gruntfile.js index 8f53bd3..8bf07c2 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -103,7 +103,8 @@ }, files: { srcBlob: '<%= dirs.src %>/**/*.js', - testBlob: '<%= dirs.test %>/{functional,lib/pixi,unit/pixi}/**/*.js', + testBlob: '<%= dirs.test %>/**/*.js', + testConf: '<%= dirs.test %>/karma.conf.js', build: '<%= dirs.build %>/pixi.dev.js', buildMin: '<%= dirs.build %>/pixi.js' }, @@ -131,10 +132,16 @@ options: { jshintrc: './.jshintrc' }, - source: srcFiles.filter(function(v) { return v.match(/(Intro|Outro|Spine|Pixi)\.js$/) === null; }).concat('Gruntfile.js'), + source: { + src: srcFiles.concat('Gruntfile.js'), + options: { + ignores: '<%= dirs.src %>/**/{Intro,Outro,Spine,Pixi}.js' + } + }, test: { src: ['<%= files.testBlob %>'], options: { + ignores: '<%= dirs.test %>/lib/resemble.js', jshintrc: undefined, //don't use jshintrc for tests expr: true, undef: false, @@ -184,7 +191,7 @@ }, karma: { unit: { - configFile: 'test/karma.conf.js', + configFile: '<%= files.testConf %>', // browsers: ['Chrome'], singleRun: true } diff --git a/README.md b/README.md index 7806d6c..1258485 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,8 @@ ### Demos ### +- [WebGL Filters!]() + - [Run pixi run]() - [Fight for Everyone]() @@ -150,3 +152,5 @@ ``` This content is released under the (http://opensource.org/licenses/MIT) MIT License. + +[![Analytics](https://ga-beacon.appspot.com/UA-39213431-2/pixi.js/index)](https://github.com/igrigorik/ga-beacon) diff --git a/bower.json b/bower.json index c1ecdb6..a8b9375 100644 --- a/bower.json +++ b/bower.json @@ -1,11 +1,11 @@ { "name": "pixi.js", - "version": "1.4.0", + "version": "1.4.1", "main": "bin/pixi.js", "ignore": [ - "**/.*" + "**/.*", "node_modules", "bower_components", "test" diff --git a/package.json b/package.json index 7d535b5..0f575c9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pixi.js", - "version": "1.4.0", + "version": "1.4.2", "description": "Pixi.js is a fast lightweight 2D library that works across all devices.", "author": "Mat Groves", @@ -28,7 +28,7 @@ "dependencies": {}, "devDependencies": { "grunt": "~0.4.1", - "grunt-contrib-jshint": "git+https://github.com/englercj/grunt-contrib-jshint.git", + "grunt-contrib-jshint": "~0.8", "grunt-contrib-uglify": "~0.2", "grunt-contrib-connect": "~0.5", "grunt-contrib-yuidoc": "~0.5", @@ -37,7 +37,9 @@ "mocha": "~1.15", "chai": "~1.8", "karma": "~0.10", + "karma-chrome-launcher": "~0.1", "karma-firefox-launcher": "~0.1", - "karma-mocha": "~0.1" + "karma-mocha": "~0.1", + "karma-spec-reporter": "~0.0.6" } } diff --git a/.travis.yml b/.travis.yml index 70cd6d5..1c60690 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,10 +8,16 @@ - dev install: - - npm install -g grunt-cli - - export DISPLAY=:99.0 - - sh -e /etc/init.d/xvfb start + - npm install grunt-cli - npm install +cache: + directories: + - node_modules + +before_script: + - export DISPLAY=:99.0 + - sh -e /etc/init.d/xvfb start + script: - - grunt travis \ No newline at end of file + - ./node_modules/.bin/grunt travis \ No newline at end of file diff --git a/Gruntfile.js b/Gruntfile.js index 8f53bd3..8bf07c2 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -103,7 +103,8 @@ }, files: { srcBlob: '<%= dirs.src %>/**/*.js', - testBlob: '<%= dirs.test %>/{functional,lib/pixi,unit/pixi}/**/*.js', + testBlob: '<%= dirs.test %>/**/*.js', + testConf: '<%= dirs.test %>/karma.conf.js', build: '<%= dirs.build %>/pixi.dev.js', buildMin: '<%= dirs.build %>/pixi.js' }, @@ -131,10 +132,16 @@ options: { jshintrc: './.jshintrc' }, - source: srcFiles.filter(function(v) { return v.match(/(Intro|Outro|Spine|Pixi)\.js$/) === null; }).concat('Gruntfile.js'), + source: { + src: srcFiles.concat('Gruntfile.js'), + options: { + ignores: '<%= dirs.src %>/**/{Intro,Outro,Spine,Pixi}.js' + } + }, test: { src: ['<%= files.testBlob %>'], options: { + ignores: '<%= dirs.test %>/lib/resemble.js', jshintrc: undefined, //don't use jshintrc for tests expr: true, undef: false, @@ -184,7 +191,7 @@ }, karma: { unit: { - configFile: 'test/karma.conf.js', + configFile: '<%= files.testConf %>', // browsers: ['Chrome'], singleRun: true } diff --git a/README.md b/README.md index 7806d6c..1258485 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,8 @@ ### Demos ### +- [WebGL Filters!]() + - [Run pixi run]() - [Fight for Everyone]() @@ -150,3 +152,5 @@ ``` This content is released under the (http://opensource.org/licenses/MIT) MIT License. + +[![Analytics](https://ga-beacon.appspot.com/UA-39213431-2/pixi.js/index)](https://github.com/igrigorik/ga-beacon) diff --git a/bower.json b/bower.json index c1ecdb6..a8b9375 100644 --- a/bower.json +++ b/bower.json @@ -1,11 +1,11 @@ { "name": "pixi.js", - "version": "1.4.0", + "version": "1.4.1", "main": "bin/pixi.js", "ignore": [ - "**/.*" + "**/.*", "node_modules", "bower_components", "test" diff --git a/package.json b/package.json index 7d535b5..0f575c9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pixi.js", - "version": "1.4.0", + "version": "1.4.2", "description": "Pixi.js is a fast lightweight 2D library that works across all devices.", "author": "Mat Groves", @@ -28,7 +28,7 @@ "dependencies": {}, "devDependencies": { "grunt": "~0.4.1", - "grunt-contrib-jshint": "git+https://github.com/englercj/grunt-contrib-jshint.git", + "grunt-contrib-jshint": "~0.8", "grunt-contrib-uglify": "~0.2", "grunt-contrib-connect": "~0.5", "grunt-contrib-yuidoc": "~0.5", @@ -37,7 +37,9 @@ "mocha": "~1.15", "chai": "~1.8", "karma": "~0.10", + "karma-chrome-launcher": "~0.1", "karma-firefox-launcher": "~0.1", - "karma-mocha": "~0.1" + "karma-mocha": "~0.1", + "karma-spec-reporter": "~0.0.6" } } diff --git a/src/pixi/renderers/canvas/utils/CanvasTinter.js b/src/pixi/renderers/canvas/utils/CanvasTinter.js index 6d6b13a..470a39f 100644 --- a/src/pixi/renderers/canvas/utils/CanvasTinter.js +++ b/src/pixi/renderers/canvas/utils/CanvasTinter.js @@ -171,9 +171,9 @@ var rgbValues = PIXI.hex2rgb(color); - rgbValues[0] = Math.round(rgbValues[0] * step) / step; - rgbValues[1] = Math.round(rgbValues[1] * step) / step; - rgbValues[2] = Math.round(rgbValues[2] * step) / step; + rgbValues[0] = Math.min(255, Math.round(rgbValues[0] / step) * step); + rgbValues[1] = Math.min(255, Math.round(rgbValues[1] / step) * step); + rgbValues[2] = Math.min(255, Math.round(rgbValues[2] / step) * step); return PIXI.rgb2hex(rgbValues); }; diff --git a/.travis.yml b/.travis.yml index 70cd6d5..1c60690 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,10 +8,16 @@ - dev install: - - npm install -g grunt-cli - - export DISPLAY=:99.0 - - sh -e /etc/init.d/xvfb start + - npm install grunt-cli - npm install +cache: + directories: + - node_modules + +before_script: + - export DISPLAY=:99.0 + - sh -e /etc/init.d/xvfb start + script: - - grunt travis \ No newline at end of file + - ./node_modules/.bin/grunt travis \ No newline at end of file diff --git a/Gruntfile.js b/Gruntfile.js index 8f53bd3..8bf07c2 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -103,7 +103,8 @@ }, files: { srcBlob: '<%= dirs.src %>/**/*.js', - testBlob: '<%= dirs.test %>/{functional,lib/pixi,unit/pixi}/**/*.js', + testBlob: '<%= dirs.test %>/**/*.js', + testConf: '<%= dirs.test %>/karma.conf.js', build: '<%= dirs.build %>/pixi.dev.js', buildMin: '<%= dirs.build %>/pixi.js' }, @@ -131,10 +132,16 @@ options: { jshintrc: './.jshintrc' }, - source: srcFiles.filter(function(v) { return v.match(/(Intro|Outro|Spine|Pixi)\.js$/) === null; }).concat('Gruntfile.js'), + source: { + src: srcFiles.concat('Gruntfile.js'), + options: { + ignores: '<%= dirs.src %>/**/{Intro,Outro,Spine,Pixi}.js' + } + }, test: { src: ['<%= files.testBlob %>'], options: { + ignores: '<%= dirs.test %>/lib/resemble.js', jshintrc: undefined, //don't use jshintrc for tests expr: true, undef: false, @@ -184,7 +191,7 @@ }, karma: { unit: { - configFile: 'test/karma.conf.js', + configFile: '<%= files.testConf %>', // browsers: ['Chrome'], singleRun: true } diff --git a/README.md b/README.md index 7806d6c..1258485 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,8 @@ ### Demos ### +- [WebGL Filters!]() + - [Run pixi run]() - [Fight for Everyone]() @@ -150,3 +152,5 @@ ``` This content is released under the (http://opensource.org/licenses/MIT) MIT License. + +[![Analytics](https://ga-beacon.appspot.com/UA-39213431-2/pixi.js/index)](https://github.com/igrigorik/ga-beacon) diff --git a/bower.json b/bower.json index c1ecdb6..a8b9375 100644 --- a/bower.json +++ b/bower.json @@ -1,11 +1,11 @@ { "name": "pixi.js", - "version": "1.4.0", + "version": "1.4.1", "main": "bin/pixi.js", "ignore": [ - "**/.*" + "**/.*", "node_modules", "bower_components", "test" diff --git a/package.json b/package.json index 7d535b5..0f575c9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pixi.js", - "version": "1.4.0", + "version": "1.4.2", "description": "Pixi.js is a fast lightweight 2D library that works across all devices.", "author": "Mat Groves", @@ -28,7 +28,7 @@ "dependencies": {}, "devDependencies": { "grunt": "~0.4.1", - "grunt-contrib-jshint": "git+https://github.com/englercj/grunt-contrib-jshint.git", + "grunt-contrib-jshint": "~0.8", "grunt-contrib-uglify": "~0.2", "grunt-contrib-connect": "~0.5", "grunt-contrib-yuidoc": "~0.5", @@ -37,7 +37,9 @@ "mocha": "~1.15", "chai": "~1.8", "karma": "~0.10", + "karma-chrome-launcher": "~0.1", "karma-firefox-launcher": "~0.1", - "karma-mocha": "~0.1" + "karma-mocha": "~0.1", + "karma-spec-reporter": "~0.0.6" } } diff --git a/src/pixi/renderers/canvas/utils/CanvasTinter.js b/src/pixi/renderers/canvas/utils/CanvasTinter.js index 6d6b13a..470a39f 100644 --- a/src/pixi/renderers/canvas/utils/CanvasTinter.js +++ b/src/pixi/renderers/canvas/utils/CanvasTinter.js @@ -171,9 +171,9 @@ var rgbValues = PIXI.hex2rgb(color); - rgbValues[0] = Math.round(rgbValues[0] * step) / step; - rgbValues[1] = Math.round(rgbValues[1] * step) / step; - rgbValues[2] = Math.round(rgbValues[2] * step) / step; + rgbValues[0] = Math.min(255, Math.round(rgbValues[0] / step) * step); + rgbValues[1] = Math.min(255, Math.round(rgbValues[1] / step) * step); + rgbValues[2] = Math.min(255, Math.round(rgbValues[2] / step) * step); return PIXI.rgb2hex(rgbValues); }; diff --git a/tasks/karma.js b/tasks/karma.js index c340485..e20aca5 100644 --- a/tasks/karma.js +++ b/tasks/karma.js @@ -1,27 +1,22 @@ -'use strict'; - -var path = require('path'); -var server = require('karma').server; - module.exports = function (grunt) { - grunt.registerMultiTask('karma', 'run karma.', function() { - var done = this.async(); - var options = this.options({ - background: false - }); - var data = this.data; + 'use strict'; - //merge options onto data, with data taking precedence - data = grunt.util._.merge(options, data); - data.configFile = path.resolve(data.configFile); - if (data.configFile) { - data.configFile = grunt.template.process(data.configFile); + var path = require('path'); + var server = require('karma').server; + + grunt.registerMultiTask('karma', 'run karma.', function(target) { + //merge data onto options, with data taking precedence + var options = grunt.util._.merge(this.options(), this.data), + done = this.async(); + + if (options.configFile) { + options.configFile = grunt.template.process(options.configFile); + options.configFile = path.resolve(options.configFile); } - server.start( - data, - function(code) { - done(!code); - }); + done = this.async(); + server.start(options, function(code) { + done(!code); + }); }); }; diff --git a/.travis.yml b/.travis.yml index 70cd6d5..1c60690 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,10 +8,16 @@ - dev install: - - npm install -g grunt-cli - - export DISPLAY=:99.0 - - sh -e /etc/init.d/xvfb start + - npm install grunt-cli - npm install +cache: + directories: + - node_modules + +before_script: + - export DISPLAY=:99.0 + - sh -e /etc/init.d/xvfb start + script: - - grunt travis \ No newline at end of file + - ./node_modules/.bin/grunt travis \ No newline at end of file diff --git a/Gruntfile.js b/Gruntfile.js index 8f53bd3..8bf07c2 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -103,7 +103,8 @@ }, files: { srcBlob: '<%= dirs.src %>/**/*.js', - testBlob: '<%= dirs.test %>/{functional,lib/pixi,unit/pixi}/**/*.js', + testBlob: '<%= dirs.test %>/**/*.js', + testConf: '<%= dirs.test %>/karma.conf.js', build: '<%= dirs.build %>/pixi.dev.js', buildMin: '<%= dirs.build %>/pixi.js' }, @@ -131,10 +132,16 @@ options: { jshintrc: './.jshintrc' }, - source: srcFiles.filter(function(v) { return v.match(/(Intro|Outro|Spine|Pixi)\.js$/) === null; }).concat('Gruntfile.js'), + source: { + src: srcFiles.concat('Gruntfile.js'), + options: { + ignores: '<%= dirs.src %>/**/{Intro,Outro,Spine,Pixi}.js' + } + }, test: { src: ['<%= files.testBlob %>'], options: { + ignores: '<%= dirs.test %>/lib/resemble.js', jshintrc: undefined, //don't use jshintrc for tests expr: true, undef: false, @@ -184,7 +191,7 @@ }, karma: { unit: { - configFile: 'test/karma.conf.js', + configFile: '<%= files.testConf %>', // browsers: ['Chrome'], singleRun: true } diff --git a/README.md b/README.md index 7806d6c..1258485 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,8 @@ ### Demos ### +- [WebGL Filters!]() + - [Run pixi run]() - [Fight for Everyone]() @@ -150,3 +152,5 @@ ``` This content is released under the (http://opensource.org/licenses/MIT) MIT License. + +[![Analytics](https://ga-beacon.appspot.com/UA-39213431-2/pixi.js/index)](https://github.com/igrigorik/ga-beacon) diff --git a/bower.json b/bower.json index c1ecdb6..a8b9375 100644 --- a/bower.json +++ b/bower.json @@ -1,11 +1,11 @@ { "name": "pixi.js", - "version": "1.4.0", + "version": "1.4.1", "main": "bin/pixi.js", "ignore": [ - "**/.*" + "**/.*", "node_modules", "bower_components", "test" diff --git a/package.json b/package.json index 7d535b5..0f575c9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pixi.js", - "version": "1.4.0", + "version": "1.4.2", "description": "Pixi.js is a fast lightweight 2D library that works across all devices.", "author": "Mat Groves", @@ -28,7 +28,7 @@ "dependencies": {}, "devDependencies": { "grunt": "~0.4.1", - "grunt-contrib-jshint": "git+https://github.com/englercj/grunt-contrib-jshint.git", + "grunt-contrib-jshint": "~0.8", "grunt-contrib-uglify": "~0.2", "grunt-contrib-connect": "~0.5", "grunt-contrib-yuidoc": "~0.5", @@ -37,7 +37,9 @@ "mocha": "~1.15", "chai": "~1.8", "karma": "~0.10", + "karma-chrome-launcher": "~0.1", "karma-firefox-launcher": "~0.1", - "karma-mocha": "~0.1" + "karma-mocha": "~0.1", + "karma-spec-reporter": "~0.0.6" } } diff --git a/src/pixi/renderers/canvas/utils/CanvasTinter.js b/src/pixi/renderers/canvas/utils/CanvasTinter.js index 6d6b13a..470a39f 100644 --- a/src/pixi/renderers/canvas/utils/CanvasTinter.js +++ b/src/pixi/renderers/canvas/utils/CanvasTinter.js @@ -171,9 +171,9 @@ var rgbValues = PIXI.hex2rgb(color); - rgbValues[0] = Math.round(rgbValues[0] * step) / step; - rgbValues[1] = Math.round(rgbValues[1] * step) / step; - rgbValues[2] = Math.round(rgbValues[2] * step) / step; + rgbValues[0] = Math.min(255, Math.round(rgbValues[0] / step) * step); + rgbValues[1] = Math.min(255, Math.round(rgbValues[1] / step) * step); + rgbValues[2] = Math.min(255, Math.round(rgbValues[2] / step) * step); return PIXI.rgb2hex(rgbValues); }; diff --git a/tasks/karma.js b/tasks/karma.js index c340485..e20aca5 100644 --- a/tasks/karma.js +++ b/tasks/karma.js @@ -1,27 +1,22 @@ -'use strict'; - -var path = require('path'); -var server = require('karma').server; - module.exports = function (grunt) { - grunt.registerMultiTask('karma', 'run karma.', function() { - var done = this.async(); - var options = this.options({ - background: false - }); - var data = this.data; + 'use strict'; - //merge options onto data, with data taking precedence - data = grunt.util._.merge(options, data); - data.configFile = path.resolve(data.configFile); - if (data.configFile) { - data.configFile = grunt.template.process(data.configFile); + var path = require('path'); + var server = require('karma').server; + + grunt.registerMultiTask('karma', 'run karma.', function(target) { + //merge data onto options, with data taking precedence + var options = grunt.util._.merge(this.options(), this.data), + done = this.async(); + + if (options.configFile) { + options.configFile = grunt.template.process(options.configFile); + options.configFile = path.resolve(options.configFile); } - server.start( - data, - function(code) { - done(!code); - }); + done = this.async(); + server.start(options, function(code) { + done(!code); + }); }); }; diff --git a/test/karma.conf.js b/test/karma.conf.js index cf5f7c1..6c63217 100644 --- a/test/karma.conf.js +++ b/test/karma.conf.js @@ -17,12 +17,12 @@ ], // list of files to exclude - exclude : [], + //exclude : [], // use dolts reporter, as travis terminal does not support escaping sequences // possible values: 'dots', 'progress', 'junit', 'teamcity' // CLI --reporters progress - reporters : ['progress'], + reporters : ['spec'], // web server port // CLI --port 9876 @@ -39,7 +39,7 @@ // level of logging // possible values: karma.LOG_DISABLE || karma.LOG_ERROR || karma.LOG_WARN || karma.LOG_INFO || karma.LOG_DEBUG // CLI --log-level debug - logLevel : config.LOG_DEBUG, + logLevel : config.LOG_INFO, // enable / disable watching file and executing tests whenever any file changes // CLI --auto-watch --no-auto-watch @@ -69,14 +69,15 @@ reportSlowerThan : 500, preprocessors : { - // '**/client/js/*.js': 'coverage' + // '**/client/js/*.js': 'coverage' }, plugins : [ - 'karma-mocha', - // 'karma-chrome-launcher', + 'karma-chrome-launcher', 'karma-firefox-launcher', + 'karma-mocha', // 'karma-phantomjs-launcher' + 'karma-spec-reporter' ] }); }; diff --git a/.travis.yml b/.travis.yml index 70cd6d5..1c60690 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,10 +8,16 @@ - dev install: - - npm install -g grunt-cli - - export DISPLAY=:99.0 - - sh -e /etc/init.d/xvfb start + - npm install grunt-cli - npm install +cache: + directories: + - node_modules + +before_script: + - export DISPLAY=:99.0 + - sh -e /etc/init.d/xvfb start + script: - - grunt travis \ No newline at end of file + - ./node_modules/.bin/grunt travis \ No newline at end of file diff --git a/Gruntfile.js b/Gruntfile.js index 8f53bd3..8bf07c2 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -103,7 +103,8 @@ }, files: { srcBlob: '<%= dirs.src %>/**/*.js', - testBlob: '<%= dirs.test %>/{functional,lib/pixi,unit/pixi}/**/*.js', + testBlob: '<%= dirs.test %>/**/*.js', + testConf: '<%= dirs.test %>/karma.conf.js', build: '<%= dirs.build %>/pixi.dev.js', buildMin: '<%= dirs.build %>/pixi.js' }, @@ -131,10 +132,16 @@ options: { jshintrc: './.jshintrc' }, - source: srcFiles.filter(function(v) { return v.match(/(Intro|Outro|Spine|Pixi)\.js$/) === null; }).concat('Gruntfile.js'), + source: { + src: srcFiles.concat('Gruntfile.js'), + options: { + ignores: '<%= dirs.src %>/**/{Intro,Outro,Spine,Pixi}.js' + } + }, test: { src: ['<%= files.testBlob %>'], options: { + ignores: '<%= dirs.test %>/lib/resemble.js', jshintrc: undefined, //don't use jshintrc for tests expr: true, undef: false, @@ -184,7 +191,7 @@ }, karma: { unit: { - configFile: 'test/karma.conf.js', + configFile: '<%= files.testConf %>', // browsers: ['Chrome'], singleRun: true } diff --git a/README.md b/README.md index 7806d6c..1258485 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,8 @@ ### Demos ### +- [WebGL Filters!]() + - [Run pixi run]() - [Fight for Everyone]() @@ -150,3 +152,5 @@ ``` This content is released under the (http://opensource.org/licenses/MIT) MIT License. + +[![Analytics](https://ga-beacon.appspot.com/UA-39213431-2/pixi.js/index)](https://github.com/igrigorik/ga-beacon) diff --git a/bower.json b/bower.json index c1ecdb6..a8b9375 100644 --- a/bower.json +++ b/bower.json @@ -1,11 +1,11 @@ { "name": "pixi.js", - "version": "1.4.0", + "version": "1.4.1", "main": "bin/pixi.js", "ignore": [ - "**/.*" + "**/.*", "node_modules", "bower_components", "test" diff --git a/package.json b/package.json index 7d535b5..0f575c9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pixi.js", - "version": "1.4.0", + "version": "1.4.2", "description": "Pixi.js is a fast lightweight 2D library that works across all devices.", "author": "Mat Groves", @@ -28,7 +28,7 @@ "dependencies": {}, "devDependencies": { "grunt": "~0.4.1", - "grunt-contrib-jshint": "git+https://github.com/englercj/grunt-contrib-jshint.git", + "grunt-contrib-jshint": "~0.8", "grunt-contrib-uglify": "~0.2", "grunt-contrib-connect": "~0.5", "grunt-contrib-yuidoc": "~0.5", @@ -37,7 +37,9 @@ "mocha": "~1.15", "chai": "~1.8", "karma": "~0.10", + "karma-chrome-launcher": "~0.1", "karma-firefox-launcher": "~0.1", - "karma-mocha": "~0.1" + "karma-mocha": "~0.1", + "karma-spec-reporter": "~0.0.6" } } diff --git a/src/pixi/renderers/canvas/utils/CanvasTinter.js b/src/pixi/renderers/canvas/utils/CanvasTinter.js index 6d6b13a..470a39f 100644 --- a/src/pixi/renderers/canvas/utils/CanvasTinter.js +++ b/src/pixi/renderers/canvas/utils/CanvasTinter.js @@ -171,9 +171,9 @@ var rgbValues = PIXI.hex2rgb(color); - rgbValues[0] = Math.round(rgbValues[0] * step) / step; - rgbValues[1] = Math.round(rgbValues[1] * step) / step; - rgbValues[2] = Math.round(rgbValues[2] * step) / step; + rgbValues[0] = Math.min(255, Math.round(rgbValues[0] / step) * step); + rgbValues[1] = Math.min(255, Math.round(rgbValues[1] / step) * step); + rgbValues[2] = Math.min(255, Math.round(rgbValues[2] / step) * step); return PIXI.rgb2hex(rgbValues); }; diff --git a/tasks/karma.js b/tasks/karma.js index c340485..e20aca5 100644 --- a/tasks/karma.js +++ b/tasks/karma.js @@ -1,27 +1,22 @@ -'use strict'; - -var path = require('path'); -var server = require('karma').server; - module.exports = function (grunt) { - grunt.registerMultiTask('karma', 'run karma.', function() { - var done = this.async(); - var options = this.options({ - background: false - }); - var data = this.data; + 'use strict'; - //merge options onto data, with data taking precedence - data = grunt.util._.merge(options, data); - data.configFile = path.resolve(data.configFile); - if (data.configFile) { - data.configFile = grunt.template.process(data.configFile); + var path = require('path'); + var server = require('karma').server; + + grunt.registerMultiTask('karma', 'run karma.', function(target) { + //merge data onto options, with data taking precedence + var options = grunt.util._.merge(this.options(), this.data), + done = this.async(); + + if (options.configFile) { + options.configFile = grunt.template.process(options.configFile); + options.configFile = path.resolve(options.configFile); } - server.start( - data, - function(code) { - done(!code); - }); + done = this.async(); + server.start(options, function(code) { + done(!code); + }); }); }; diff --git a/test/karma.conf.js b/test/karma.conf.js index cf5f7c1..6c63217 100644 --- a/test/karma.conf.js +++ b/test/karma.conf.js @@ -17,12 +17,12 @@ ], // list of files to exclude - exclude : [], + //exclude : [], // use dolts reporter, as travis terminal does not support escaping sequences // possible values: 'dots', 'progress', 'junit', 'teamcity' // CLI --reporters progress - reporters : ['progress'], + reporters : ['spec'], // web server port // CLI --port 9876 @@ -39,7 +39,7 @@ // level of logging // possible values: karma.LOG_DISABLE || karma.LOG_ERROR || karma.LOG_WARN || karma.LOG_INFO || karma.LOG_DEBUG // CLI --log-level debug - logLevel : config.LOG_DEBUG, + logLevel : config.LOG_INFO, // enable / disable watching file and executing tests whenever any file changes // CLI --auto-watch --no-auto-watch @@ -69,14 +69,15 @@ reportSlowerThan : 500, preprocessors : { - // '**/client/js/*.js': 'coverage' + // '**/client/js/*.js': 'coverage' }, plugins : [ - 'karma-mocha', - // 'karma-chrome-launcher', + 'karma-chrome-launcher', 'karma-firefox-launcher', + 'karma-mocha', // 'karma-phantomjs-launcher' + 'karma-spec-reporter' ] }); }; diff --git a/test/unit/pixi/display/Stage.js b/test/unit/pixi/display/Stage.js index 3cc2a4d..480a45b 100644 --- a/test/unit/pixi/display/Stage.js +++ b/test/unit/pixi/display/Stage.js @@ -19,7 +19,6 @@ expect(obj).to.respondTo('updateTransform'); expect(obj).to.respondTo('setBackgroundColor'); expect(obj).to.respondTo('getMousePosition'); - // FIXME: duplicate member in DisplayObject pixi_core_Matrix_confirmNewMat3(obj.worldTransform); // FIXME: convert arg to bool in constructor @@ -44,6 +43,7 @@ expect(obj).to.have.deep.property('backgroundColorSplit[2]', 0); expect(obj).to.have.property('backgroundColorString', '#000000'); + expect(obj).to.have.property('worldVisible', true); }); });