Optimize simulator for light mode. (#379)
* Optimize simulator for light mode. * Add user-select none.
This commit is contained in:
@ -109,7 +109,7 @@ namespace pxsim.visuals {
|
||||
}
|
||||
});
|
||||
|
||||
export function randomTheme(): IBoardTheme {
|
||||
export function randomTheme(highContrast?: boolean, light?: boolean): IBoardTheme {
|
||||
return themes[Math.floor(Math.random() * themes.length)];
|
||||
}
|
||||
|
||||
@ -303,7 +303,7 @@ namespace pxsim.visuals {
|
||||
this.wrapper = document.createElement('div');
|
||||
this.wrapper.style.display = 'inline';
|
||||
|
||||
this.element = svg.elt("svg", { height: "100%", width: "100%" }) as SVGSVGElement;
|
||||
this.element = svg.elt("svg", { height: "100%", width: "100%", "class": "user-select-none" }) as SVGSVGElement;
|
||||
|
||||
this.defs = svg.child(this.element, "defs") as SVGDefsElement;
|
||||
|
||||
@ -391,6 +391,9 @@ namespace pxsim.visuals {
|
||||
cancelAnimationFrame(animationId);
|
||||
})
|
||||
}
|
||||
// Kill the brick
|
||||
this.layoutView.getBrick().kill();
|
||||
|
||||
// Save previous inputs for the next cycle
|
||||
EV3View.previousSelectedInputs = ev3board().getInputNodes().map((node, index) => (this.getDisplayViewForNode(node.id, index).getSelected()) ? node.id : -1)
|
||||
EV3View.previousSeletedOutputs = ev3board().getMotors().map((node, index) => (this.getDisplayViewForNode(node.id, index).getSelected()) ? node.id : -1);
|
||||
|
Reference in New Issue
Block a user