support for resizing simulator based on usage of parts

This commit is contained in:
Peli de Halleux
2016-08-30 17:18:03 -07:00
parent 8f50beb938
commit 90da72a8de
2 changed files with 12 additions and 6 deletions

View File

@ -14,16 +14,16 @@ namespace pxsim.visuals {
constructor(state: DalBoard, boardDef: BoardDefinition, cmpsList: string[], cmpDefs: Map<ComponentDefinition>, fnArgs: any) {
this.state = state;
let onboardCmps = boardDef.onboardComponents || [];
let activeComponents = cmpsList.filter(c => onboardCmps.indexOf(c) < 0);
let activeComponents = (cmpsList || []).filter(c => onboardCmps.indexOf(c) < 0);
activeComponents.sort();
if (boardDef.visual === "microbit") {
// if (boardDef.visual === "microbit") {
this.boardView = new visuals.MicrobitBoardSvg({
runtime: runtime,
theme: visuals.randomTheme(),
disableTilt: false
});
} else {
// } else {
//TODO: port Arduino/generic board
// this.boardView = new visuals.GenericBoardSvg({
// boardDef: boardDef,
@ -32,7 +32,7 @@ namespace pxsim.visuals {
// runtime: runtime,
// fnArgs: fnArgs
// })
}
// }
const VIEW_WIDTH = "100%";
const VIEW_HEIGHT = "100%";