public void paintCurve(Graphics2D g2d) { // this paints a line between consecutive points
        for(FunctionSubpanel sub : Client.equationPanel.functionList){
            g2d.setColor(sub.graphColor);
            g2d.setStroke(new BasicStroke(1));
            for(int i = 0; i < sub.getPointsList().size() - 1; i++){
                if(Math.abs(-sub.getPointsList().get(i + 1).getY() - (-sub.getPointsList().get(i).getY())) < 500)
                    g2d.drawLine(sub.getPointsList().get(i).getX() + (int)(this.getPreferredSize().width/2),
                             -sub.getPointsList().get(i).getY() + (int)(this.getPreferredSize().height/2),
                             sub.getPointsList().get(i + 1).getX() + (int)(this.getPreferredSize().width/2),
                             -sub.getPointsList().get(i + 1).getY() + (int)(this.getPreferredSize().height/2));
            }
        }
    }