Comparing version 1.3.0 to 1.3.1
{ | ||
"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.", | ||
@@ -9,0 +7,0 @@ "main": "dist/milsymbol.js", |
# 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 | ||
@@ -4,0 +20,0 @@ |
@@ -5,2 +5,2 @@ ## milsymbol in LeafLet - L.divIcon() | ||
This example is using LeafLet 0.7.3. | ||
This example is using LeafLet 1.0.1. |
{ | ||
"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.", | ||
@@ -34,5 +34,4 @@ "main": "dist/milsymbol.js", | ||
"prettier": "^1.5.2", | ||
"webpack": "^3.3.0", | ||
"webpack-custom-var-library-name-plugin": "^1.0.2" | ||
"webpack": "^3.3.0" | ||
} | ||
} |
@@ -53,3 +53,3 @@ /*! | ||
this.autoSVG = false; | ||
this.version = "1.3.0"; | ||
this.version = "1.3.1"; | ||
@@ -56,0 +56,0 @@ if (typeof console === "object") { |
@@ -45,3 +45,3 @@ var ms = require("../ms.js"); | ||
case "path": | ||
if (typeof Path2D != "undefined") { | ||
if (!ms._brokenPath2D) { | ||
var d = new Path2D(instruction[i].d); | ||
@@ -169,2 +169,25 @@ if ( | ||
if (typeof ms._brokenPath2D == "undefined") { | ||
/* In EdgeHTML14 Microsoft implemented support for Path2D, but they didn't implement support | ||
for initiating it with a SVG path, and if you initiate it with an SVG path, it will not throw | ||
an error, instead it will return an empty path and log a warning. | ||
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 | ||
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); | ||
// 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"); | ||
} | ||
} | ||
var canvas = document.createElement("canvas"); | ||
@@ -171,0 +194,0 @@ //TODO fix the pixel ratio |
@@ -59,3 +59,5 @@ var ms = require("../ms.js"); | ||
} | ||
if (m.bbox) this.bbox.merge(m.bbox); | ||
if (typeof m.bbox === "object") { | ||
this.bbox.merge(m.bbox); | ||
} | ||
} | ||
@@ -62,0 +64,0 @@ |
const path = require("path"); | ||
const CustomVarLibraryNamePlugin = require("webpack-custom-var-library-name-plugin"); | ||
@@ -9,2 +8,17 @@ module.exports = function(env) { | ||
} | ||
var libraryName = "milsymbol"; // Library base name | ||
if (target == "umd") { | ||
// If UMD target, set library name to object | ||
libraryName = { | ||
root: "ms", | ||
amd: "milsymbol", | ||
commonjs: "milsymbol" | ||
}; | ||
} | ||
if (target == "var") { | ||
// If Var target, name the library ms | ||
libraryName = "ms"; | ||
} | ||
return { | ||
@@ -15,12 +29,7 @@ entry: "./src/index.js", | ||
path: path.resolve(__dirname, "dist"), | ||
library: "milsymbol", | ||
library: libraryName, | ||
libraryTarget: target, | ||
umdNamedDefine: target == "amd" ? false : true | ||
}, | ||
plugins: [ | ||
new CustomVarLibraryNamePlugin({ | ||
name: "ms" | ||
}) | ||
] | ||
} | ||
}; | ||
}; |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
7676475
6
25106