public void render(GeneralGC gc, Rectangle visibleRegion)
{
+ gc.setAntialias(SWT.ON);
+ gc.setClipping(visibleRegion);
gc.setLineWidth(.5);
- model.getWires().forEach(w -> w.render(gc));
+ model.getWires().forEach(w ->
+ {
+ Rectangle bounds = w.getBounds();
+ double lw = gc.getLineWidth();
+ if (visibleRegion.intersects(bounds.x - lw, bounds.y - lw, bounds.width + lw + lw, bounds.height + lw + lw))
+ w.render(gc);
+ });
model.getComponents().forEach(c -> renderComponent(gc, c, visibleRegion));
}
if (DRAW_PINS)
{
gc.setBackground(gc.getDevice().getSystemColor(SWT.COLOR_DARK_CYAN));
- for (Pin p : component.getPins())
+ for (Pin p : component.getPins().values())
{
Point pos = p.getPos();
gc.fillOval(pos.x - 1, pos.y - 1, 2, 2);