Optimize simulator for light mode. (#379)

* Optimize simulator for light mode.

* Add user-select none.
This commit is contained in:
Sam El-Husseini
2018-03-28 13:36:52 -07:00
committed by GitHub
parent b4b3a24ed2
commit 0dc2548d0b
25 changed files with 108 additions and 631 deletions

View File

@ -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);