Skip to content

Commit

Permalink
Merge branch 'release/1.0.10'
Browse files Browse the repository at this point in the history
  • Loading branch information
jondavidjohn committed Sep 23, 2016
2 parents 5c6f3f6 + c60a54b commit d6a749a
Show file tree
Hide file tree
Showing 11 changed files with 39 additions and 24 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/node_modules
npm-debug.log
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[submodule "test/qunit"]
path = test/qunit
url = git@github.com:jquery/qunit.git
url = https://github.com/jquery/qunit.git
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
language: node_js
5 changes: 5 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
= 1.0.10
* Fixed iOS 10 API deprication (#17)
* Add Travis CI
* Include minified build in release

= 1.0.9
* True fix for issue with lineWidth handling in stroke (#14)

Expand Down
12 changes: 6 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Yay, you're interested in helping this thing suck less. Good for you!
Some things you should be familiar with before getting started

- Unit testing (with [QUnit](http://qunitjs.com))
- [Grunt](http://gruntjs.org) (available via `npm install -g grunt-cli`)
- [Grunt](http://gruntjs.org)
- [Node/NPM](https://npmjs.org/) (available via homebrew)

## Project Layout
Expand All @@ -17,15 +17,15 @@ Some things you should be familiar with before getting started

## Development

Once you have NPM and Grunt installed, clone the repository (with `--recursive` to also clone all submodules) and install all dependencies
Once you have npm installed, clone the repository (with `--recursive` to also clone all submodules) and install all dependencies

git clone [email protected] --recursive
cd hidpi-canvas-polyfill
npm install

Then to build a distribution run this grunt task
Then to build a distribution run

grunt dist
npm run build

This will generate the compiled (and minified) sourc in your `dist/` directory
along with a distributable zip archive.
Expand All @@ -35,7 +35,7 @@ need to re-run this command.

You can also use

grunt watch
npm run watch

to automatically reconcat the unminified file everytime you
change any of the `src/**/*.js` files.
Expand All @@ -49,7 +49,7 @@ sure to organize and produce tests that fit the patterns present.

### Running Tests

grunt test
npm test

## On Contribution

Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# HiDPI Canvas Polyfill

[![Build Status](https://travis-ci.org/jondavidjohn/hidpi-canvas-polyfill.svg?branch=master)](https://travis-ci.org/jondavidjohn/hidpi-canvas-polyfill)

This is a drop-in polyfill to scale canvas appropriately to maintain sharpness
in browsers that currently do not provide the appropriately scaled backing
store to do this automatically.
Expand All @@ -14,7 +16,7 @@ without having to modify any of your canvas code.
Currently this plugin handles most general cross browser drawing functions, but
feel free to send Pull Requests as you find functions you need supported.

If the function simply needs all or some of it's arguments multiplied by the ratio,
If the function simply needs all or some of its arguments multiplied by the ratio,
it should simply require you to add it to the `ratioArgs` object, following the proper
pattern.

Expand Down
4 changes: 2 additions & 2 deletions bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "hidpi-canvas",
"version": "1.0.9",
"version": "1.0.10",
"homepage": "https://github.com/jondavidjohn/hidpi-canvas-polyfill",
"authors": [
"Jonathan Johnson <[email protected]>"
Expand All @@ -13,7 +13,7 @@
"polyfill"
],
"main": "dist/hidpi-canvas.js",
"license": "Apache 2.0",
"license": "Apache-2.0",
"ignore": [
"**/.*",
"node_modules",
Expand Down
12 changes: 7 additions & 5 deletions dist/hidpi-canvas.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,25 @@
/**
* HiDPI Canvas Polyfill (1.0.9)
* HiDPI Canvas Polyfill (1.0.10)
*
* Author: Jonathan D. Johnson (http://jondavidjohn.com)
* Homepage: https://github.com/jondavidjohn/hidpi-canvas-polyfill
* Issue Tracker: https://github.com/jondavidjohn/hidpi-canvas-polyfill/issues
* License: Apache 2.0
* License: Apache-2.0
*/
(function(prototype) {

var pixelRatio = (function(context) {
var backingStore = context.backingStorePixelRatio ||
var pixelRatio = (function() {
var canvas = document.createElement('canvas'),
context = canvas.getContext('2d'),
backingStore = context.backingStorePixelRatio ||
context.webkitBackingStorePixelRatio ||
context.mozBackingStorePixelRatio ||
context.msBackingStorePixelRatio ||
context.oBackingStorePixelRatio ||
context.backingStorePixelRatio || 1;

return (window.devicePixelRatio || 1) / backingStore;
})(prototype),
})(),

forEach = function(obj, func) {
for (var p in obj) {
Expand Down
6 changes: 3 additions & 3 deletions dist/hidpi-canvas.min.js

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

8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "hidpi-canvas",
"description": "A JavaScript drop-in module to polyfill consistent and automatic HiDPI Canvas support.",
"version": "1.0.9",
"license": "Apache 2.0",
"version": "1.0.10",
"license": "Apache-2.0",
"homepage": "https://github.com/jondavidjohn/hidpi-canvas-polyfill",
"bugs": "https://github.com/jondavidjohn/hidpi-canvas-polyfill/issues",
"repository": {
Expand All @@ -23,6 +23,8 @@
},
"scripts": {
"test": "grunt",
"prepublish": "grunt dist"
"watch": "grunt watch",
"build": "grunt dist",
"prepublish": "npm run build"
}
}
8 changes: 5 additions & 3 deletions src/CanvasRenderingContext2D.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
(function(prototype) {

var pixelRatio = (function(context) {
var backingStore = context.backingStorePixelRatio ||
var pixelRatio = (function() {
var canvas = document.createElement('canvas'),
context = canvas.getContext('2d'),
backingStore = context.backingStorePixelRatio ||
context.webkitBackingStorePixelRatio ||
context.mozBackingStorePixelRatio ||
context.msBackingStorePixelRatio ||
context.oBackingStorePixelRatio ||
context.backingStorePixelRatio || 1;

return (window.devicePixelRatio || 1) / backingStore;
})(prototype),
})(),

forEach = function(obj, func) {
for (var p in obj) {
Expand Down

0 comments on commit d6a749a

Please sign in to comment.