Fixes issue where the MouseInputListener was improperly added to the Canvas, resulting in some weird render/component update issues.
@@ -11,7 +11,11 @@ import lombok.Getter;
import lombok.NonNull;
import lombok.ToString;
-import java.awt.*;
+import javax.swing.event.MouseInputListener;
+import java.awt.Canvas;
+import java.awt.Dimension;
+import java.awt.Graphics2D;
+import java.awt.RenderingHints;
import java.awt.event.KeyListener;
import java.awt.event.MouseListener;
import java.awt.event.MouseMotionListener;
@@ -206,6 +210,12 @@ public class Panel implements Receiver<String> {
return;
}
+ if (eventListener instanceof MouseInputListener) {
+ canvas.addMouseListener((MouseListener) eventListener);
+ canvas.addMouseMotionListener((MouseMotionListener) eventListener);
+ return;
+ }
+
if (eventListener instanceof MouseListener) {
canvas.addMouseListener((MouseListener) eventListener);
return;
