Skip to content

Commit

Permalink
Merge branch 'hotfix/1.0.6'
Browse files Browse the repository at this point in the history
  • Loading branch information
jondavidjohn committed Jul 9, 2014
2 parents e097712 + c204153 commit d296b27
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 5 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
= 1.0.6
* Performance improvement, early bail if pixel ratio is 1 (#13)

= 1.0.5
* Correct bower file with "main" entry
* Add `createLinearGradient` support
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "hidpi-canvas",
"version": "1.0.5",
"version": "1.0.6",
"homepage": "https://github.com/jondavidjohn/hidpi-canvas-polyfill",
"authors": [
"Jonathan Johnson <[email protected]>"
Expand Down
8 changes: 7 additions & 1 deletion dist/hidpi-canvas.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* HiDPI Canvas Polyfill (1.0.5)
* HiDPI Canvas Polyfill (1.0.6)
*
* Author: Jonathan D. Johnson (http://jondavidjohn.com)
* Homepage: https://github.com/jondavidjohn/hidpi-canvas-polyfill
Expand Down Expand Up @@ -54,6 +54,8 @@
ratio = getPixelRatio(this),
args = Array.prototype.slice.call(arguments);

if (ratio === 1) return _super.apply(this, args);

if (value === 'all') {
args = args.map(function(a) {
return a * ratio;
Expand All @@ -77,6 +79,8 @@
var ratio = getPixelRatio(this),
args = Array.prototype.slice.call(arguments);

if (ratio === 1) return _super.apply(this, args);

args[1] *= ratio; // x
args[2] *= ratio; // y

Expand All @@ -103,6 +107,8 @@
var ratio = getPixelRatio(this),
args = Array.prototype.slice.call(arguments);

if (ratio === 1) return _super.apply(this, args);

args[1] *= ratio; // x
args[2] *= ratio; // y

Expand Down
4 changes: 2 additions & 2 deletions dist/hidpi-canvas.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "hidpi-canvas",
"description": "A JavaScript drop-in module to polyfill consistent and automatic HiDPI Canvas support.",
"version": "1.0.5",
"version": "1.0.6",
"license": "Apache 2.0",
"homepage": "https://github.com/jondavidjohn/hidpi-canvas-polyfill",
"bugs": "https://github.com/jondavidjohn/hidpi-canvas-polyfill/issues",
Expand Down
6 changes: 6 additions & 0 deletions src/CanvasRenderingContext2D.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@
ratio = getPixelRatio(this),
args = Array.prototype.slice.call(arguments);

if (ratio === 1) return _super.apply(this, args);

if (value === 'all') {
args = args.map(function(a) {
return a * ratio;
Expand All @@ -69,6 +71,8 @@
var ratio = getPixelRatio(this),
args = Array.prototype.slice.call(arguments);

if (ratio === 1) return _super.apply(this, args);

args[1] *= ratio; // x
args[2] *= ratio; // y

Expand All @@ -95,6 +99,8 @@
var ratio = getPixelRatio(this),
args = Array.prototype.slice.call(arguments);

if (ratio === 1) return _super.apply(this, args);

args[1] *= ratio; // x
args[2] *= ratio; // y

Expand Down

0 comments on commit d296b27

Please sign in to comment.