kopia lustrzana https://github.com/backface/turtlestitch
added aspect racio governance and generator tags to trails SVGs
rodzic
391be73691
commit
6d5ddad06c
|
@ -13,6 +13,7 @@
|
|||
* objects: export pen trails as SVG (under construction)
|
||||
* threads: new "pen trails (SVG)" reporter (experimental, hidden in dev)
|
||||
* objects, threads: adjusted rotation center of SVG-pen-trails
|
||||
* objects: added aspect racio governance and generator tags to trails SVGs
|
||||
|
||||
## v5.3.8:
|
||||
* **Notable Change:**
|
||||
|
|
|
@ -8953,19 +8953,13 @@ StageMorph.prototype.trailsLogAsSVG = function () { // +++
|
|||
});
|
||||
box = bottomLeft.corner(topRight).expandBy(maxWidth / 2);
|
||||
shift = new Point(-bottomLeft.x, topRight.y).translateBy(maxWidth / 2);
|
||||
svg = '<svg ' +
|
||||
svg = '<svg xmlns="http://www.w3.org/2000/svg" ' +
|
||||
'preserveAspectRatio="none" ' +
|
||||
'viewBox="0 0 ' + box.width() + ' ' + box.height() + '" ' +
|
||||
'width="' + box.width() + '" height="' + box.height() + '" ' +
|
||||
// 'style="background-color:black" ' + // for supporting backgrounds
|
||||
'xmlns="http://www.w3.org/2000/svg">';
|
||||
|
||||
// to do:
|
||||
// * add source comment ("exported from Snap! etc."
|
||||
// * add "keep aspect ratio" governance
|
||||
// * catch / disable if the trails log is empty
|
||||
// * catch if the trails contain non-vectorizable elements (stamp, fill)
|
||||
// * decide how to handle background colors
|
||||
// * consider a logging limit to prevent an overflowing queue
|
||||
'>';
|
||||
svg += '<!-- Generated by Snap! - http://snap.berkeley.edu/ -->';
|
||||
|
||||
// for debugging the viewBox:
|
||||
// svg += '<rect width="100%" height="100%" fill="black"/>'
|
||||
|
|
Ładowanie…
Reference in New Issue