prevent tool direction change with tabs. fix dark mode arrow colors
This commit is contained in:
parent
a2c282a072
commit
ed4b5dba7a
4 changed files with 17 additions and 11 deletions
|
|
@ -602,7 +602,7 @@
|
|||
poly.forEachPoint(function(point, pidx, points, offset) {
|
||||
camOut(point.clone(), offset !== 0);
|
||||
}, poly.isClosed(), index);
|
||||
});
|
||||
}, { swapdir: false });
|
||||
newLayer();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -435,7 +435,7 @@
|
|||
if (ease) {
|
||||
start.z += ease;
|
||||
}
|
||||
start = poly2polyEmit(inside, start, emitter, { mark: "emark", perm: true });
|
||||
start = poly2polyEmit(inside, start, emitter, { mark: "emark", perm: true, swapdir: false });
|
||||
if (ease) {
|
||||
start.z += ease;
|
||||
}
|
||||
|
|
@ -447,8 +447,8 @@
|
|||
let frag = ftops.filter(p => p.open);
|
||||
let full = ftops.filter(p => !p.open);
|
||||
|
||||
poly2polyEmit(full, start, roughTopEmit, { mark: "emark" });
|
||||
poly2polyEmit(frag, start, roughTopEmit, { mark: "emark" });
|
||||
poly2polyEmit(full, start, roughTopEmit, { mark: "emark", swapdir: false });
|
||||
poly2polyEmit(frag, start, roughTopEmit, { mark: "emark", swapdir: false });
|
||||
|
||||
return start;
|
||||
}
|
||||
|
|
@ -493,7 +493,7 @@
|
|||
fromPoint = depthOutlinePath(fromPoint, depth + 1, levels, radius, emitter, dir, ease);
|
||||
fromPoint = depthOutlinePath(fromPoint, depth + 1, levels, radius, emitter, !dir, ease);
|
||||
return fromPoint;
|
||||
}, {weight: false});
|
||||
}, { weight: false, swapdir: false });
|
||||
return start;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -732,10 +732,14 @@
|
|||
}
|
||||
}
|
||||
|
||||
FDM.isDark = function() {
|
||||
return current.print.settings.controller.dark ? true : false;
|
||||
};
|
||||
|
||||
FDM.rateToColor = function(rate, max) {
|
||||
return current.print.settings.controller.dark ?
|
||||
darkColorFunction(rate/max, 1, 0.85) :
|
||||
currentColorFunction(rate/max, 1, 0.85);
|
||||
return FDM.isDark() ?
|
||||
darkColorFunction(rate/max, 1, 0.85) :
|
||||
currentColorFunction(rate/max, 1, 0.85);
|
||||
};
|
||||
|
||||
FDM.prepareRender = function(levels, update, opts = {}) {
|
||||
|
|
@ -745,6 +749,7 @@
|
|||
return [];
|
||||
}
|
||||
|
||||
const dark = FDM.isDark();
|
||||
const tools = opts.tools || {};
|
||||
const flat = opts.flat;
|
||||
const thin = opts.thin && !flat;
|
||||
|
|
@ -752,7 +757,7 @@
|
|||
const headColor = 0x888888;
|
||||
const moveColor = opts.move >= 0 ? opts.move : 0xaaaaaa;
|
||||
const printColor = opts.print >= 0 ? opts.print : 0x777700;
|
||||
const arrowAll = false;
|
||||
const arrowAll = true;
|
||||
const arrowSize = arrowAll ? 0.2 : 0.4;
|
||||
const layers = [];
|
||||
const toolMode = opts.toolMode;
|
||||
|
|
@ -919,8 +924,9 @@
|
|||
}), { outline: true });
|
||||
}
|
||||
if (heads.length) {
|
||||
let line = dark ? 0xffffff : 0x112233;
|
||||
output
|
||||
.setLayer('arrows', { face: headColor, line: 0x112233, opacity: 0.5 }, true)
|
||||
.setLayer('arrows', { face: headColor, line, opacity: 0.75 }, true)
|
||||
.addAreas(heads.map(points => {
|
||||
const {p1, p2} = points;
|
||||
const slope = p2.slopeTo(p1);
|
||||
|
|
|
|||
|
|
@ -1225,7 +1225,7 @@
|
|||
if (d2f > mindist && d2l > mindist) {
|
||||
continue;
|
||||
}
|
||||
if (d2l < mindist && d2l < d2f) {
|
||||
if (d2l < mindist && d2l < d2f && opt.swapdir !== false) {
|
||||
poly.reverse();
|
||||
found = {poly:poly, index:0, point:poly.first()};
|
||||
mindist = d2l;
|
||||
|
|
|
|||
Loading…
Reference in a new issue