Skip to content

Commit

Permalink
Merge pull request #2 from tris/master
Browse files Browse the repository at this point in the history
Adjustments for Roland VersaWorks
  • Loading branch information
talyguryn authored Apr 15, 2021
2 parents caed0cf + b2fed05 commit 135c883
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/contourer.js
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ class Contourer {

/**
* @async
* Append encoded image to the end of SVG body
* Insert encoded image at the beginning of SVG body
*/
async mergeSvgAndEncodedBitmapImage() {
await log.info('Merge SVG and encoded image');
Expand All @@ -324,10 +324,16 @@ class Contourer {
let imageTag = `<image width="${this.size.width}" height="${this.size.height}" xlink:href="${this.encodedImage}" />`;

/**
* Add image tag at the end of SVG body
* Fix path stroke width
* @type {string}
*/
result = result.replace('</svg>', `${imageTag}</svg>`);
result = result.replace('<path ', '<path stroke-width="0.25" ');

/**
* Add image tag just before path
* @type {string}
*/
result = result.replace('<path', `${imageTag}\n<path`);

this.resultSVG = result;
}
Expand Down

0 comments on commit 135c883

Please sign in to comment.