mirror of
https://github.com/xibyte/jsketcher
synced 2026-01-04 06:47:01 +01:00
autofix eslint issues
This commit is contained in:
parent
23fce9f638
commit
caa2520312
13 changed files with 42 additions and 42 deletions
|
|
@ -17,7 +17,7 @@ export default class Bus {
|
|||
}
|
||||
listenerList.push(callback);
|
||||
return callback;
|
||||
};
|
||||
}
|
||||
|
||||
unsubscribe(key, callback) {
|
||||
const listenerList = this.listeners[key];
|
||||
|
|
@ -27,7 +27,7 @@ export default class Bus {
|
|||
return;
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
tokensToStates(tokens) {
|
||||
return tokens.map( token => this.state[token] );
|
||||
|
|
@ -100,7 +100,7 @@ export default class Bus {
|
|||
} finally {
|
||||
this.lock.delete(key);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
enableState(forToken, initValue) {
|
||||
this.keepStateFor.add(forToken);
|
||||
|
|
|
|||
|
|
@ -4,4 +4,4 @@ export default function(data, fileName) {
|
|||
link.href = "data:application/octet-stream;charset=utf-8;base64," + btoa(data);
|
||||
link.download = fileName;
|
||||
link.click();
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,4 +20,4 @@ export default function shallowEqual(objA, objB) {
|
|||
}
|
||||
|
||||
return true;
|
||||
};
|
||||
}
|
||||
|
|
@ -22,7 +22,7 @@ export class Emitter extends StreamBase {
|
|||
this.observers.splice(i, 1);
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
next(value) {
|
||||
if (this.state === EMITTING) {
|
||||
|
|
|
|||
|
|
@ -51,8 +51,8 @@ export class OpenFaceView extends SketchingView {
|
|||
|
||||
createGeometry() {
|
||||
|
||||
const vertices = [];;
|
||||
const normals = [];;
|
||||
const vertices = [];
|
||||
const normals = [];
|
||||
const normal = normalOfCCWSeq(this.bounds);
|
||||
this.bounds.forEach((v, i) => {
|
||||
vertices.push(v.x, v.y, v.z);
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@ export class View {
|
|||
this.disposers.call();
|
||||
this.model.ext.view = null;
|
||||
this.model = null;
|
||||
};
|
||||
}
|
||||
|
||||
get isDisposed() {
|
||||
return this.model === null;
|
||||
|
|
|
|||
|
|
@ -128,7 +128,7 @@ export class InPlaceSketcher {
|
|||
this.viewer.setTransformation(xx.x * width, xx.y * height, yy.x * width, yy.y* height,
|
||||
(sketchOriginDelta.x) * width + width,
|
||||
(sketchOriginDelta.y) * height + height, sceneSetup.oCamera.zoom);
|
||||
};
|
||||
}
|
||||
|
||||
save() {
|
||||
this.ctx.services.storage.set(this.sketchStorageKey, this.viewer.io.serializeSketch({
|
||||
|
|
|
|||
|
|
@ -12,11 +12,11 @@ export class ContractibleObject {
|
|||
this.visitParams(p => out.push(p));
|
||||
}
|
||||
|
||||
init() {};
|
||||
init() {}
|
||||
|
||||
visitParams() {};
|
||||
visitParams() {}
|
||||
|
||||
visitChildren() {};
|
||||
visitChildren() {}
|
||||
|
||||
traverse(visitor) {
|
||||
visitor(this);
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ export class Coincident extends AbstractConstraint {
|
|||
|
||||
static deserialize(refs, data) {
|
||||
return new Coincident(refs(data[0]), refs(data[1]));
|
||||
};
|
||||
}
|
||||
|
||||
constructor(a, b) {
|
||||
super();
|
||||
|
|
@ -26,7 +26,7 @@ export class Coincident extends AbstractConstraint {
|
|||
this.b = b;
|
||||
a.linked.push(b);
|
||||
b.linked.push(a);
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
getSolveData() {
|
||||
|
|
@ -566,12 +566,12 @@ export class SignedPerpendicular extends AbstractConstraint {
|
|||
|
||||
static deserialize(refs, data) {
|
||||
return new SignedPerpendicular(refs(data[0]), refs(data[1]), refs(data[2]), refs(data[3]));
|
||||
};
|
||||
}
|
||||
|
||||
constructor(p1, p2, p3, p4) {
|
||||
super();
|
||||
this.points = [p1, p2, p3, p4];
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
getSolveData() {
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ export class LoopPickTool extends Tool {
|
|||
this.marked.clear();
|
||||
this.pointToObject.clear();
|
||||
this.pickedLoop = null;
|
||||
};
|
||||
}
|
||||
|
||||
cleanup() {
|
||||
this.clearMarked();
|
||||
|
|
@ -102,7 +102,7 @@ export class LoopPickTool extends Tool {
|
|||
}
|
||||
}
|
||||
this.viewer.refresh();
|
||||
};
|
||||
}
|
||||
|
||||
pickLoop(p) {
|
||||
const pickResult = this.viewer.search(p.x, p.y, DEFAULT_SEARCH_BUFFER, true, false, []);
|
||||
|
|
@ -124,9 +124,9 @@ export class LoopPickTool extends Tool {
|
|||
} else {
|
||||
this.onMousedown(e);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
onMousedown(e) {};
|
||||
onMousedown(e) {}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -8,17 +8,17 @@ export class ReferencePointTool extends Tool {
|
|||
|
||||
restart() {
|
||||
this.sendSpecifyPointHint();
|
||||
};
|
||||
}
|
||||
|
||||
cleanup(e) {
|
||||
this.viewer.cleanSnap();
|
||||
};
|
||||
}
|
||||
|
||||
mousemove(e) {
|
||||
var p = this.viewer.screenToModel(e);
|
||||
this.viewer.snap(p.x, p.y, []);
|
||||
this.viewer.refresh();
|
||||
};
|
||||
}
|
||||
|
||||
mousedown(e) {
|
||||
const needSnap = this.viewer.snapped != null;
|
||||
|
|
@ -28,7 +28,7 @@ export class ReferencePointTool extends Tool {
|
|||
this.pointPicked(p.x, p.y);
|
||||
this.viewer.refresh();
|
||||
this.viewer.toolManager.releaseControl();
|
||||
};
|
||||
}
|
||||
|
||||
processCommand(command) {
|
||||
const referencePoint = this.viewer.referencePoint;
|
||||
|
|
@ -40,7 +40,7 @@ export class ReferencePointTool extends Tool {
|
|||
referencePoint.y += result.y;
|
||||
this.viewer.refresh();
|
||||
this.viewer.toolManager.releaseControl();
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -137,15 +137,15 @@ export class DelegatingPanTool extends BasePanTool {
|
|||
|
||||
startDragging(e) {
|
||||
this.delegate.dispatchEvent(cloneEvent(e));
|
||||
};
|
||||
}
|
||||
|
||||
mouseup(e) {
|
||||
this.delegate.dispatchEvent(cloneEvent(e));
|
||||
};
|
||||
}
|
||||
|
||||
mousewheel(e) {
|
||||
this.delegate.dispatchEvent(cloneEvent(e));
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
function cloneEvent(event) {
|
||||
|
|
|
|||
|
|
@ -7,41 +7,41 @@ export class Tool {
|
|||
this.viewer = viewer;
|
||||
}
|
||||
|
||||
restart() {};
|
||||
restart() {}
|
||||
|
||||
cleanup() {};
|
||||
cleanup() {}
|
||||
|
||||
mousemove(e) {};
|
||||
mousemove(e) {}
|
||||
|
||||
mousedown(e) {};
|
||||
mousedown(e) {}
|
||||
|
||||
mouseup(e) {};
|
||||
mouseup(e) {}
|
||||
|
||||
dblclick(e) {};
|
||||
dblclick(e) {}
|
||||
|
||||
keydown(e) {};
|
||||
keydown(e) {}
|
||||
|
||||
keypress(e) {};
|
||||
keypress(e) {}
|
||||
|
||||
keyup(e) {};
|
||||
keyup(e) {}
|
||||
|
||||
sendMessage(text) {
|
||||
this.viewer.streams.tool.$message.next(text);
|
||||
};
|
||||
}
|
||||
|
||||
sendHint(hint) {
|
||||
this.viewer.streams.tool.$hint.next(hint);
|
||||
};
|
||||
}
|
||||
|
||||
sendSpecifyPointHint() {
|
||||
this.sendHint('specify point');
|
||||
};
|
||||
}
|
||||
|
||||
pointPicked(x, y) {
|
||||
this.sendMessage('picked: ' + this.viewer.roundToPrecision(x) + " : " + this.viewer.roundToPrecision(y));
|
||||
this.viewer.referencePoint.x = x;
|
||||
this.viewer.referencePoint.y = y;
|
||||
};
|
||||
}
|
||||
|
||||
snapIfNeed(p) {
|
||||
if (this.viewer.snapped != null) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue