Fixed mouse hovering detection
[sixth-3d.git] / src / main / java / eu / svjatoslav / sixth / e3d / renderer / raster / shapes / basic / solidpolygon / SolidPolygon.java
index e45a991..faefb2a 100644 (file)
@@ -11,12 +11,13 @@ package eu.svjatoslav.sixth.e3d.renderer.raster.shapes.basic.solidpolygon;
 
 import eu.svjatoslav.sixth.e3d.geometry.Point2D;
 import eu.svjatoslav.sixth.e3d.geometry.Point3D;
-import eu.svjatoslav.sixth.e3d.geometry.Polygon;
 import eu.svjatoslav.sixth.e3d.gui.RenderingContext;
 import eu.svjatoslav.sixth.e3d.gui.humaninput.MouseInteractionController;
 import eu.svjatoslav.sixth.e3d.renderer.raster.Color;
 import eu.svjatoslav.sixth.e3d.renderer.raster.shapes.AbstractCoordinateShape;
 
+import static eu.svjatoslav.sixth.e3d.geometry.Polygon.pointWithinPolygon;
+
 public class SolidPolygon extends AbstractCoordinateShape {
 
     private final static LineInterpolator polygonBoundary1 = new LineInterpolator();
@@ -103,10 +104,10 @@ public class SolidPolygon extends AbstractCoordinateShape {
         onScreenPoint3.roundToInteger();
 
         if (mouseInteractionController != null)
-            if (context.mouseEvent != null)
-                if (Polygon.pointWithinPolygon(context.mouseEvent.coordinate,
+            if (context.getMouseEvent() != null)
+                if (pointWithinPolygon(context.getMouseEvent().coordinate,
                         onScreenPoint1, onScreenPoint2, onScreenPoint3))
-                    context.objectUnderMouse = mouseInteractionController;
+                    context.setObjectUnderMouse(mouseInteractionController);
 
         if (color.isTransparent())
             return;