title: The actor is selected only in a position 1 cell higher or 1 cell lower than it is located
body: <p>There is a playing field with dimensions of 800x600. The field is a picture with 4x4 cells .</p>
  
  <pre><code>import com.badlogic.gdx.Gdx;
  import com.badlogic.gdx.InputProcessor;
  import com.badlogic.gdx.graphics.Texture;
  
  public class TriAngle extends Figure implements InputProcessor {
  
      private float w = 800;
      private float h = 600;
  
      public TriAngle() {
  
          setTextureRegion(new Texture(Gdx.files.internal("TriAngle.png")));
          setBounds(200, 400, w / 4, h / 4);
          Gdx.input.setInputProcessor(this);
  
      }
      @Override
      public boolean keyDown(int i) {
          return false;
      }
  
      @Override
      public boolean keyUp(int i) {
          return false;
      }
  
      @Override
      public boolean keyTyped(char c) {
          return false;
      }
  
      @Override
      public boolean touchDown(int screenX, int screenY, int pointer, int button) {
  
          return true;
      }
  
      @Override
      public boolean touchUp(int screenX, int screenY, int pointer, int button) {
          return false;
      }
  
      @Override
      public boolean touchDragged(int screenX, int screenY, int pointer) {
  
          if((screenX &gt; getX() &amp;&amp; screenX &lt; getX() + getWidth())&amp;&amp;(screenY &gt; getY() &amp;&amp; screenY &lt; getY() + getHeight())){
              this.setPosition(screenX, screenY, 0);
          }
          return true;
      }
  
      @Override
      public boolean mouseMoved(int x, int y) {
        /* if (x &gt;= 0) {
              this.setPosition(x,y);
          }*/
  
          return true;
      }
  
      @Override
      public boolean scrolled(int i) {
          return false;
      }
  }
  </code></pre>
  
  <p>Кругом помечена клетка при которой нажимая кнопкой мыши происходит перемещения треугольника.Крестиком помечены ячейки при которых нажимая мышкой ничего не просиходит.</p>
  
  <p><a href="https://i.stack.imgur.com/cOo0q.png" rel="nofollow noreferrer">enter image description here</a></p>
  
  <p><a href="https://i.stack.imgur.com/UtYcG.png" rel="nofollow noreferrer">enter image description here</a></p>
  
  <p>How do I make the selection of the working cell strictly under the triangle? And why does the working cell change depending on the position of the triangle (1 cell above the triangle or 1 cell below it )?</p>