{
gc.setAntialias(SWT.ON);
gc.setClipping(visibleRegion);
- gc.setLineWidth(Preferences.current().getDouble("net.mograsim.logic.model.linewidth"));
+ gc.setLineWidth(Preferences.current().getDouble("net.mograsim.logic.model.linewidth.default"));
model.getWiresByName().values().forEach(w ->
{
Rectangle bounds = w.getBounds();
}
conf.reset(gc);
// reset line width explicitly to avoid rounding errors causing weird glitches
- gc.setLineWidth(Preferences.current().getDouble("net.mograsim.logic.model.linewidth"));
+ gc.setLineWidth(Preferences.current().getDouble("net.mograsim.logic.model.linewidth.default"));
// draw the outline after all other operations to make interface pins look better
renderOutline(gc, visibleRegion);
}
import net.mograsim.logic.model.model.ViewModelModifiable;
import net.mograsim.preferences.ColorDefinition;
import net.mograsim.preferences.ColorManager;
+import net.mograsim.preferences.Preferences;
/**
* A wire connecting exactly two {@link Pin}s.
*/
public void render(GeneralGC gc)
{
- // TODO maybe make wires with logicWidth!=1 thicker? Maybe make thickness selectable?
ColorDefinition wireColor = BitVectorFormatter.formatAsColor(end);
if (wireColor != null)
gc.setForeground(ColorManager.current().toColor(wireColor));
+ if (logicWidth == 1)
+ gc.setLineWidth(Preferences.current().getDouble("net.mograsim.logic.model.linewidth.wire.singlebit"));
+ else
+ gc.setLineWidth(Preferences.current().getDouble("net.mograsim.logic.model.linewidth.wire.multibit"));
gc.drawPolyline(effectivePath);
+ gc.setLineWidth(Preferences.current().getDouble("net.mograsim.logic.model.linewidth.default"));
}
// operations concerning the path
{
switch (name)
{
- case "net.mograsim.logic.model.linewidth":
+ case "net.mograsim.logic.model.linewidth.default":
return 0.5;
+ case "net.mograsim.logic.model.linewidth.wire.singlebit":
+ return 0.5;
+ case "net.mograsim.logic.model.linewidth.wire.multibit":
+ return 0.85;
default:
throw new IllegalArgumentException("Unknown double preference name: " + name);
}