X-Git-Url: http://www2.svjatoslav.eu/gitweb/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Feu%2Fsvjatoslav%2Fsixth%2Fe3d%2Frenderer%2Fraster%2Fshapes%2Fbasic%2Fsolidpolygon%2FSolidPolygon.java;h=1ef63f4d8b8219b8adb451873059913bee92bcea;hb=59baa428fb2d9e7f0fe5423f4cea47f2d6245914;hp=00ae317565d37cad9a011938e521697f29c398db;hpb=c9cca2ea38fd301c4383d14178589c09520bea22;p=sixth-3d.git diff --git a/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/basic/solidpolygon/SolidPolygon.java b/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/basic/solidpolygon/SolidPolygon.java index 00ae317..1ef63f4 100644 --- a/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/basic/solidpolygon/SolidPolygon.java +++ b/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/basic/solidpolygon/SolidPolygon.java @@ -1,5 +1,5 @@ /* - * Sixth 3D engine. Copyright ©2012-2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu + * Sixth 3D engine. Copyright ©2012-2019, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu * * This program is free software; you can redistribute it and/or * modify it under the terms of version 3 of the GNU Lesser General Public License @@ -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.mouseClick != null) - if (Polygon.pointWithinPolygon(context.mouseClick.coordinate, + if (context.getMouseEvent() != null) + if (pointWithinPolygon(context.getMouseEvent().coordinate, onScreenPoint1, onScreenPoint2, onScreenPoint3)) - context.clickedItem = mouseInteractionController; + context.setObjectUnderMouse(mouseInteractionController); if (color.isTransparent()) return;