Update padding and fix wiring order

This commit is contained in:
Sam El-Husseini 2017-12-26 23:19:04 -08:00
parent afaedaa0b2
commit c398a5a133
5 changed files with 11 additions and 11 deletions

View File

@ -12,6 +12,7 @@ namespace pxsim.visuals {
constructor(protected parent: SVGSVGElement, protected globalDefs: SVGDefsElement, protected state: T, protected port: number) {
super(state);
}
getInnerWidth(): number {
@ -57,7 +58,6 @@ namespace pxsim.visuals {
}
onComponentVisible() {
}
}
}

View File

@ -153,12 +153,6 @@ namespace pxsim.visuals {
this.contentGroup = svg.elt("g") as SVGGElement;
this.scrollGroup = svg.child(this.contentGroup, "g") as SVGGElement;
// Inject all view containers
for (let i = 0; i < 4; i++) {
this.inputContainers[i].inject(this.scrollGroup);
this.outputContainers[i].inject(this.scrollGroup);
}
this.inputs = [];
this.outputs = [];
this.inputControls = [];
@ -172,6 +166,12 @@ namespace pxsim.visuals {
this.inputWires[port].inject(this.scrollGroup);
}
// Inject all view containers
for (let i = 0; i < 4; i++) {
this.inputContainers[i].inject(this.scrollGroup);
this.outputContainers[i].inject(this.scrollGroup);
}
// Inject all ports
this.setInput(0, new PortView(0, 'A'));
this.setInput(1, new PortView(1, 'B'));
@ -267,7 +267,7 @@ namespace pxsim.visuals {
currentY = moduleHeight;
const wireBrickSpacing = brickWidth / 5;
const wiringYPadding = 0;
const wiringYPadding = 5;
let wireStartX = 0;
let wireEndX = brickPadding + wireBrickSpacing;
let wireEndY = currentY + this.getWiringHeight() + wiringYPadding;

View File

@ -10,7 +10,7 @@ namespace pxsim.visuals {
}
public getPaddingRatio() {
return 1 / 6;
return 1 / 4;
}
public updateState() {

View File

@ -8,7 +8,7 @@ namespace pxsim.visuals {
}
public getPaddingRatio() {
return 1 / 4;
return 0.3;
}
}
}

View File

@ -17,7 +17,7 @@ namespace pxsim.visuals {
}
public getPaddingRatio() {
return 1 / 10;
return 1 / 4;
}
public hasClick() {