@Override
    public void mouseDragged(MouseEvent e) {
        if (tempCard == null) {
            return;
        }
        int newx = tempCard.getXpos() - tempX + e.getX();
        int newy = tempCard.getYpos() - tempY + e.getY();
        int margin = TCard.H() / 2;
        if (newx < margin) {
            newx = margin;
        } else if (newx > Table.SIZE.width - margin) {
            newx = Table.SIZE.width - margin;
        }
        if (newy < margin) {
            newy = margin;
        } else if (newy > Table.SIZE.height - margin) {
            newy = Table.SIZE.height - margin;
        }
        tempCard.setCardPosition(newx, newy);
    }