support for resizing simulator based on usage of parts
This commit is contained in:
parent
8f50beb938
commit
90da72a8de
@ -75,7 +75,13 @@
|
|||||||
},
|
},
|
||||||
"simulator": {
|
"simulator": {
|
||||||
"autoRun": true,
|
"autoRun": true,
|
||||||
"aspectRatio": 0.69
|
"aspectRatio": 1.22,
|
||||||
|
"partsAspectRatio": 0.69,
|
||||||
|
"builtinParts": {
|
||||||
|
"accelerometer": true,
|
||||||
|
"buttonpair": true,
|
||||||
|
"ledmatrix": true
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"compileService": {
|
"compileService": {
|
||||||
"yottaTarget": "bbc-microbit-classic-gcc",
|
"yottaTarget": "bbc-microbit-classic-gcc",
|
||||||
|
@ -14,16 +14,16 @@ namespace pxsim.visuals {
|
|||||||
constructor(state: DalBoard, boardDef: BoardDefinition, cmpsList: string[], cmpDefs: Map<ComponentDefinition>, fnArgs: any) {
|
constructor(state: DalBoard, boardDef: BoardDefinition, cmpsList: string[], cmpDefs: Map<ComponentDefinition>, fnArgs: any) {
|
||||||
this.state = state;
|
this.state = state;
|
||||||
let onboardCmps = boardDef.onboardComponents || [];
|
let onboardCmps = boardDef.onboardComponents || [];
|
||||||
let activeComponents = cmpsList.filter(c => onboardCmps.indexOf(c) < 0);
|
let activeComponents = (cmpsList || []).filter(c => onboardCmps.indexOf(c) < 0);
|
||||||
activeComponents.sort();
|
activeComponents.sort();
|
||||||
|
|
||||||
if (boardDef.visual === "microbit") {
|
// if (boardDef.visual === "microbit") {
|
||||||
this.boardView = new visuals.MicrobitBoardSvg({
|
this.boardView = new visuals.MicrobitBoardSvg({
|
||||||
runtime: runtime,
|
runtime: runtime,
|
||||||
theme: visuals.randomTheme(),
|
theme: visuals.randomTheme(),
|
||||||
disableTilt: false
|
disableTilt: false
|
||||||
});
|
});
|
||||||
} else {
|
// } else {
|
||||||
//TODO: port Arduino/generic board
|
//TODO: port Arduino/generic board
|
||||||
// this.boardView = new visuals.GenericBoardSvg({
|
// this.boardView = new visuals.GenericBoardSvg({
|
||||||
// boardDef: boardDef,
|
// boardDef: boardDef,
|
||||||
@ -32,7 +32,7 @@ namespace pxsim.visuals {
|
|||||||
// runtime: runtime,
|
// runtime: runtime,
|
||||||
// fnArgs: fnArgs
|
// fnArgs: fnArgs
|
||||||
// })
|
// })
|
||||||
}
|
// }
|
||||||
|
|
||||||
const VIEW_WIDTH = "100%";
|
const VIEW_WIDTH = "100%";
|
||||||
const VIEW_HEIGHT = "100%";
|
const VIEW_HEIGHT = "100%";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user