fixes #11 SVG line color control
This commit is contained in:
parent
911b0e11ea
commit
9ff0eb8c99
5 changed files with 8 additions and 6 deletions
|
|
@ -260,8 +260,9 @@ var gs_kiri_laser = exports;
|
|||
/**
|
||||
*
|
||||
*/
|
||||
LASER.exportSVG = function(print) {
|
||||
LASER.exportSVG = function(print, cut_color) {
|
||||
var lines = [], dx = 0, dy = 0, my;
|
||||
var color = cut_color || "blue";
|
||||
|
||||
exportElements(
|
||||
print,
|
||||
|
|
@ -276,7 +277,7 @@ var gs_kiri_laser = exports;
|
|||
lines.push('<svg width="'+width+'mm" height="'+height+'mm" viewBox="0 0 '+width+' '+height+'" xmlns="http://www.w3.org/2000/svg" version="1.1">');
|
||||
},
|
||||
function(poly) {
|
||||
lines.push('<polyline points="'+poly.join(' ')+'" fill="none" stroke="blue" stroke-width="0.01mm" />');
|
||||
lines.push('<polyline points="'+poly.join(' ')+'" fill="none" stroke="' + color + '" stroke-width="0.01mm" />');
|
||||
},
|
||||
function() {
|
||||
lines.push("</svg>");
|
||||
|
|
|
|||
|
|
@ -202,8 +202,8 @@ var gs_kiri_print = exports;
|
|||
return KIRI.driver.LASER.exportGCode(this);
|
||||
};
|
||||
|
||||
PRO.exportSVG = function() {
|
||||
return KIRI.driver.LASER.exportSVG(this);
|
||||
PRO.exportSVG = function(cut_color) {
|
||||
return KIRI.driver.LASER.exportSVG(this, cut_color);
|
||||
};
|
||||
|
||||
PRO.exportDXF = function() {
|
||||
|
|
|
|||
|
|
@ -893,7 +893,7 @@ self.kiri.license = exports.LICENSE;
|
|||
|
||||
function download_svg() {
|
||||
saveAs(new Blob(
|
||||
[currentPrint.exportSVG()],
|
||||
[currentPrint.exportSVG($('print-color').value)],
|
||||
{type:"application/octet-stream"}),
|
||||
$('print-filename').value + ".svg");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
var exports = {
|
||||
COPYRIGHT:"Copyright (C) 2014-2017 Stewart Allen <stewart@neuron.com> - All Rights Reserved",
|
||||
LICENSE:"Unauthorized copying, modification and re-distribution are strictly prohibited without prior written consent.",
|
||||
VERSION:"1.0.69"
|
||||
VERSION:"1.0.70"
|
||||
};
|
||||
if (!module) var module = {};
|
||||
module.exports = exports;
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
<table id="print-info">
|
||||
<tr><th>file name</th><td><input id="print-filename" size="30" spellcheck="false" /></td></tr>
|
||||
<tr><th>segments</th><td><input id="print-lines" size="10" disabled="true" /></td></tr>
|
||||
<tr><th>svg cut color</th><td><input id="print-color" size="10" value="blue" title="must be a valid SVG color" /></td></tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue