Skip to content

Commit

Permalink
Fixed Reassigning parameter lint rules
Browse files Browse the repository at this point in the history
  • Loading branch information
obany committed Aug 28, 2017
1 parent 3db56d3 commit e932de0
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 41 deletions.
3 changes: 1 addition & 2 deletions .npmignore
Expand Up @@ -12,8 +12,7 @@ src/
.eslintignore
.eslintrc.json
.travis.yml
gulpfile.js
./gulpfile.js
tsconfig.json
tslint.json
test/unit/reports/**/*
TODO.md
11 changes: 7 additions & 4 deletions .travis.yml
Expand Up @@ -3,7 +3,10 @@ node_js:
- "node"
install:
- npm install
script:
- gulp build
- gulp unit
- gulp coveralls
script:
- gulp build || travis_terminate 1
- gulp unit || travis_terminate 1
- gulp coveralls || travis_terminate 1
cache:
directories:
- node_modules
12 changes: 11 additions & 1 deletion CHANGELOG.md
@@ -1,24 +1,34 @@
# v0.2.1

* Fixed Reassigning parameter lint rules

# v0.2.0

* Finalise API
* Unit Tests and Fixes

# v0.1.4

* Housekeeping and CI Integration

# v0.1.3

* Housekeeping and CI Integration

# v0.1.2

* Added png to icns conversion

# v0.1.1

* Rationalised logging/display interfaces

# v0.1.0

* Added svg to png conversion
* Added png to ico conversion
* Added svg to mask conversion

# v0.0.1
* Initial version

* Initial version
23 changes: 8 additions & 15 deletions dist/svg.js

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions gulpfile.js
Expand Up @@ -65,7 +65,7 @@ gulp.task("build-transpile", () => {
.pipe(gulp.dest(distFolder))
.on("end", () => {
if (errorCount > 0) {
process.exit();
process.exit(1);
}
}));

Expand Down Expand Up @@ -138,7 +138,7 @@ gulp.task("unit-transpile", () => {
.pipe(gulp.dest(unitDistFolder))
.on("end", () => {
if (errorCount > 0) {
process.exit();
process.exit(1);
}
});
});
Expand Down Expand Up @@ -176,6 +176,8 @@ gulp.task("unit-runner", () => {
.pipe(mocha({
"reporter": "spec",
"timeout": "360000"
}).on("error", () => {
process.exit(1);
}))
.pipe(istanbul.writeReports({
"dir": unitReportsFolder,
Expand Down
8 changes: 4 additions & 4 deletions package.json
@@ -1,6 +1,6 @@
{
"name": "unitejs-image",
"version": "0.2.0",
"version": "0.2.1",
"description": "Core code for manipulating images",
"repository": {
"type": "git",
Expand Down Expand Up @@ -32,7 +32,7 @@
"devDependencies": {
"@types/chai": "^4.0.4",
"@types/mocha": "^2.2.42",
"@types/node": "^8.0.24",
"@types/node": "^8.0.25",
"@types/phantom": "^3.2.3",
"@types/sinon": "^2.3.3",
"chai": "^4.1.1",
Expand All @@ -51,7 +51,7 @@
"remap-istanbul": "^0.9.5",
"run-sequence": "^2.0.0",
"sinon": "^3.2.1",
"tslint": "^5.6.0",
"tslint": "^5.7.0",
"tslint-microsoft-contrib": "^5.0.1",
"typescript": "^2.5.1"
},
Expand All @@ -60,6 +60,6 @@
"jimp": "^0.2.28",
"phantom": "^4.0.5",
"text-encoding": "^0.6.4",
"unitejs-framework": "^0.8.0"
"unitejs-framework": "^0.8.1"
}
}
20 changes: 7 additions & 13 deletions src/svg.ts
Expand Up @@ -64,17 +64,10 @@ export class SVG {
logger.info("height", { height });
}

if (marginX === undefined) {
marginX = 0;
} else {
logger.info("marginX", { marginX });
}

if (marginY === undefined) {
marginY = 0;
} else {
logger.info("marginY", { marginY });
}
const mX = marginX === undefined ? 0 : marginX;
const mY = marginY === undefined ? 0 : marginY;
logger.info("marginX", { mX });
logger.info("marginY", { mY });

if (background !== null && background !== undefined && background.length > 0) {
if (!ParameterValidation.isColor(logger, "background", background)) {
Expand All @@ -94,10 +87,11 @@ export class SVG {
style += ` body { background-color: ${background}}`;
}

const reducedWidth = width - (marginX * 2);
const reducedWidth = width - (mX * 2);
style += ` img { position: absolute; left: ${mX}px; top: ${mY}px}`;
const reducedHeight = height - (marginY * 2);

style += ` img { position: absolute; left: ${marginX}px; top: ${marginY}px}`;
style += ` img { position: absolute; left: ${mX}px; top: ${mY}px}`;

const svgFilename = fileSystem.pathAbsolute(fileSystem.pathCombine(sourceFolder, sourceFile));

Expand Down

0 comments on commit e932de0

Please sign in to comment.