private void dibujarBache(Graphics grafico, Bache bache) { int x = (int)bache.X; int y = (int)bache.Y; Color color = Configuracion.COLORBACHE; if(Modificar.eliminarSeñaleticas && Modificar.estaSobre(bache)) { color = Configuracion.COLORRESALTAR; } this.dibujarOllo(grafico, color, x, y); this.dibujarID (grafico, bache.Id, Elemento.HORIZONTAL, x-12, y+12); }
public static bool estaSobre(Bache elemento) { int x = (int)elemento.X; int y = (int)elemento.Y; int xR = Modificar.posX; int yR = Modificar.posY; if (xR >= x && xR <= x + 15 && yR >= y && yR <= y + 15) { idElementoEliminar = elemento.Id; return true; } if (idElementoEliminar == elemento.Id) idElementoEliminar = -1; return false; }