def clear(self):
        """Draw a filled white rectangle over this element to clear it from the canvas."""
        padding = self.thickness  # need to overwrite a slightly larger area or some drawn edges probably will remain
        cv2.rectangle(self.target, (self.left - padding, self.top - padding),
                      (self.right + padding, self.bottom + padding),
                      (255, 255, 255), cv2.FILLED)
Draw a filled white rectangle over this element to clear it from the canvas.
apps/mnist_calc/calcui.py