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) {
|
poly.forEachPoint(function(point, pidx, points, offset) {
|
||||||
camOut(point.clone(), offset !== 0);
|
camOut(point.clone(), offset !== 0);
|
||||||
}, poly.isClosed(), index);
|
}, poly.isClosed(), index);
|
||||||
});
|
}, { swapdir: false });
|
||||||
newLayer();
|
newLayer();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -435,7 +435,7 @@
|
||||||
if (ease) {
|
if (ease) {
|
||||||
start.z += 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) {
|
if (ease) {
|
||||||
start.z += ease;
|
start.z += ease;
|
||||||
}
|
}
|
||||||
|
|
@ -447,8 +447,8 @@
|
||||||
let frag = ftops.filter(p => p.open);
|
let frag = ftops.filter(p => p.open);
|
||||||
let full = ftops.filter(p => !p.open);
|
let full = ftops.filter(p => !p.open);
|
||||||
|
|
||||||
poly2polyEmit(full, start, roughTopEmit, { mark: "emark" });
|
poly2polyEmit(full, start, roughTopEmit, { mark: "emark", swapdir: false });
|
||||||
poly2polyEmit(frag, start, roughTopEmit, { mark: "emark" });
|
poly2polyEmit(frag, start, roughTopEmit, { mark: "emark", swapdir: false });
|
||||||
|
|
||||||
return start;
|
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);
|
||||||
fromPoint = depthOutlinePath(fromPoint, depth + 1, levels, radius, emitter, !dir, ease);
|
fromPoint = depthOutlinePath(fromPoint, depth + 1, levels, radius, emitter, !dir, ease);
|
||||||
return fromPoint;
|
return fromPoint;
|
||||||
}, {weight: false});
|
}, { weight: false, swapdir: false });
|
||||||
return start;
|
return start;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -732,8 +732,12 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FDM.isDark = function() {
|
||||||
|
return current.print.settings.controller.dark ? true : false;
|
||||||
|
};
|
||||||
|
|
||||||
FDM.rateToColor = function(rate, max) {
|
FDM.rateToColor = function(rate, max) {
|
||||||
return current.print.settings.controller.dark ?
|
return FDM.isDark() ?
|
||||||
darkColorFunction(rate/max, 1, 0.85) :
|
darkColorFunction(rate/max, 1, 0.85) :
|
||||||
currentColorFunction(rate/max, 1, 0.85);
|
currentColorFunction(rate/max, 1, 0.85);
|
||||||
};
|
};
|
||||||
|
|
@ -745,6 +749,7 @@
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const dark = FDM.isDark();
|
||||||
const tools = opts.tools || {};
|
const tools = opts.tools || {};
|
||||||
const flat = opts.flat;
|
const flat = opts.flat;
|
||||||
const thin = opts.thin && !flat;
|
const thin = opts.thin && !flat;
|
||||||
|
|
@ -752,7 +757,7 @@
|
||||||
const headColor = 0x888888;
|
const headColor = 0x888888;
|
||||||
const moveColor = opts.move >= 0 ? opts.move : 0xaaaaaa;
|
const moveColor = opts.move >= 0 ? opts.move : 0xaaaaaa;
|
||||||
const printColor = opts.print >= 0 ? opts.print : 0x777700;
|
const printColor = opts.print >= 0 ? opts.print : 0x777700;
|
||||||
const arrowAll = false;
|
const arrowAll = true;
|
||||||
const arrowSize = arrowAll ? 0.2 : 0.4;
|
const arrowSize = arrowAll ? 0.2 : 0.4;
|
||||||
const layers = [];
|
const layers = [];
|
||||||
const toolMode = opts.toolMode;
|
const toolMode = opts.toolMode;
|
||||||
|
|
@ -919,8 +924,9 @@
|
||||||
}), { outline: true });
|
}), { outline: true });
|
||||||
}
|
}
|
||||||
if (heads.length) {
|
if (heads.length) {
|
||||||
|
let line = dark ? 0xffffff : 0x112233;
|
||||||
output
|
output
|
||||||
.setLayer('arrows', { face: headColor, line: 0x112233, opacity: 0.5 }, true)
|
.setLayer('arrows', { face: headColor, line, opacity: 0.75 }, true)
|
||||||
.addAreas(heads.map(points => {
|
.addAreas(heads.map(points => {
|
||||||
const {p1, p2} = points;
|
const {p1, p2} = points;
|
||||||
const slope = p2.slopeTo(p1);
|
const slope = p2.slopeTo(p1);
|
||||||
|
|
|
||||||
|
|
@ -1225,7 +1225,7 @@
|
||||||
if (d2f > mindist && d2l > mindist) {
|
if (d2f > mindist && d2l > mindist) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (d2l < mindist && d2l < d2f) {
|
if (d2l < mindist && d2l < d2f && opt.swapdir !== false) {
|
||||||
poly.reverse();
|
poly.reverse();
|
||||||
found = {poly:poly, index:0, point:poly.first()};
|
found = {poly:poly, index:0, point:poly.first()};
|
||||||
mindist = d2l;
|
mindist = d2l;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue