Skip to content

Commit 3c6b66e

Browse files
committed
Add webcam panel super component paint, refs #234
1 parent b463bd6 commit 3c6b66e

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

webcam-capture/src/main/java/com/github/sarxos/webcam/WebcamPanel.java

+5-3
Original file line numberDiff line numberDiff line change
@@ -768,11 +768,13 @@ public Painter getPainter() {
768768

769769
@Override
770770
protected void paintComponent(Graphics g) {
771-
Graphics2D g2 = (Graphics2D) g;
771+
772+
super.paintComponent(g);
773+
772774
if (image == null) {
773-
painter.paintPanel(this, g2);
775+
painter.paintPanel(this, (Graphics2D) g);
774776
} else {
775-
painter.paintImage(this, image, g2);
777+
painter.paintImage(this, image, (Graphics2D) g);
776778
}
777779
}
778780

0 commit comments

Comments
 (0)