Skip to content

Commit

Permalink
Bump version number and fix canvas in Edge
Browse files Browse the repository at this point in the history
  • Loading branch information
spatialillusions committed Oct 17, 2017
1 parent a1de5cb commit 68a3c3f
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 11 deletions.
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
# Change Log

## 1.3.1 17 OCT 2017

### Added

### Changed

### Deprecated

### Removed

### Fixed

- Fixed canvas output in Microsoft Edge 14

### Security

## 1.3.0 21 AUG 2017

### Added
Expand Down
6 changes: 2 additions & 4 deletions bower.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
{
"name": "milsymbol",
"version": "1.3.0",
"version": "1.3.1",
"homepage": "https://github.com/spatialillusions/milsymbol",
"authors": [
"Måns Beckman (http://www.spatialillusions.com)"
],
"authors": ["Måns Beckman (http://www.spatialillusions.com)"],
"description": "Milsymbol is a small library in pure javascript that creates symbols according to MIL-STD-2525 and APP6.",
"main": "dist/milsymbol.js",
"license": "MIT"
Expand Down
2 changes: 1 addition & 1 deletion dist/milsymbol.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "milsymbol",
"version": "1.3.0",
"version": "1.3.1",
"description": "Milsymbol.js is a small library in pure javascript that creates symbols according to MIL-STD-2525 and APP6.",
"main": "dist/milsymbol.js",
"directories": {
Expand Down
2 changes: 1 addition & 1 deletion src/ms.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ var ms = new function() {
this._symbolParts = [];

this.autoSVG = false;
this.version = "1.3.0";
this.version = "1.3.1";

if (typeof console === "object") {
console.info(
Expand Down
8 changes: 4 additions & 4 deletions src/symbol/ascanvas.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,19 +172,19 @@ module.exports = function(ratio) {
This will check for that behaviour and make sure we use the workaround if Path2D is broken. */
if (typeof Path2D == "undefined") {
// If Path2D dosen't exist it is definetly broken
console.info("path 2d does not exist");
ms._brokenPath2D = true;
} else {
// If Path2D exists we need to check if it is broken
var canv = document.createElement("canvas");
canv.widht = 1;
canv.height = 1;
var _ctx = canv.getContext("2d");
// Draw an SVG path to the canvas...
var p = new Path2D("M0 0 h 10 v 10 h -10 Z");
_ctx.fill(p);
// Oh this is dirty, just compare part of the base64 string to see if it is "correct"
var url = canv.toDataURL();
ms._brokenPath2D = !(url.substr(url.length - 10) == "VORK5CYII=");
// Pick a pixel and see if it is filled with black... (if not SVG is not working)
var data = _ctx.getImageData(0, 0, 1, 1).data.join();
ms._brokenPath2D = !(data == "0,0,0,255");
}
}

Expand Down

0 comments on commit 68a3c3f

Please sign in to comment.