rework stroke width/miter not to conflict w poly internals
This commit is contained in:
parent
50e7ef906a
commit
9f6c42187f
2 changed files with 4 additions and 4 deletions
|
|
@ -41,8 +41,7 @@ function parse(text, opt = { soup: true }) {
|
|||
let poly = base.newPolygon().addPoints(path.map(p => base.newPoint(p.x, -p.y, 0)));
|
||||
if (poly.appearsClosed()) poly.points.pop();
|
||||
if (type === 'polyline') poly.setOpen(true);
|
||||
if (width) poly.width = width;
|
||||
if (miter) poly.miter = miter;
|
||||
poly._svg = { width, miter };
|
||||
polys.push(poly);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -429,10 +429,11 @@ mesh.sketch = class MeshSketch extends mesh.object {
|
|||
// log(this.file || this.id, '| add polygon');
|
||||
let poly = opt.poly;
|
||||
delete opt.poly;
|
||||
let { width, miter } = poly._svg || {};
|
||||
this.add_item({
|
||||
type: "polygon",
|
||||
width: poly.width,
|
||||
miter: poly.miter,
|
||||
width,
|
||||
miter,
|
||||
selected: true,
|
||||
...Object.assign({}, { center: {x:0, y:0, z:0} }, opt),
|
||||
...poly.toObject()
|
||||
|
|
|
|||
Loading…
Reference in a new issue