mirror of
https://github.com/xibyte/jsketcher
synced 2025-12-07 00:45:08 +01:00
25 lines
774 B
JavaScript
25 lines
774 B
JavaScript
import {TestMouseEvent} from './mouse-event'
|
|
|
|
export function toModel(app, x, y) {
|
|
return app.viewer._screenToModel(x, y);
|
|
}
|
|
|
|
export function toModelP(app, point) {
|
|
return app.viewer._screenToModel(point.x, point.y);
|
|
}
|
|
|
|
export function getConstraints(app) {
|
|
return app.viewer.parametricManager.subSystems[0].constraints;
|
|
}
|
|
|
|
export function click(app, x, y) {
|
|
app.viewer.toolManager.tool.mousedown(new TestMouseEvent(x, y));
|
|
app.viewer.toolManager.tool.mouseup(new TestMouseEvent(x, y));
|
|
}
|
|
|
|
export function move(app, from, to) {
|
|
const toolManager = app.viewer.toolManager;
|
|
toolManager.tool.mousedown(new TestMouseEvent(from.x, from.y));
|
|
toolManager.tool.mousemove(new TestMouseEvent(to.x, to.y));
|
|
toolManager.tool.mouseup(new TestMouseEvent(to.x, to.y));
|
|
}
|