libgdx / libgdx/libgdx

Stage ignores mouseMove and touchDown events when moving mouse along upper bound

Open
#4,654 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug input scene2d
Dominant language
Java
Stars
25.4k
Forks
6.5k
Avg merge
1d 16h
Merged PRs (30d)
5

Description

Issue details

In GWT fullscreen mode Stage ignores mouseMove and touchDown events when moving mouse along upper bound.

Reproduction steps/code

When moving mouse along Stage's upper bound then the following is true:
Gdx.graphics.getHeight() - screenY == viewport.getScreenY() + viewport.getScreenHeight()

The methods Stage#mouseMoved and Stage#touchDown both contain the following check:

if (Gdx.graphics.getHeight() - screenY < viewport.getScreenY()
	|| Gdx.graphics.getHeight() - screenY >= viewport.getScreenY() + viewport.getScreenHeight()) return false;

which ignores the events when moving mouse along upper bound.
This check in both places should be changed to:

if (Gdx.graphics.getHeight() - screenY < viewport.getScreenY()
	|| Gdx.graphics.getHeight() - screenY > viewport.getScreenY() + viewport.getScreenHeight()) return false;
Version of LibGDX and/or relevant dependencies

all

Stacktrace

n/a

Please select the affected platforms
  • Android
  • iOS (robovm)
  • iOS (MOE)
  • HTML/GWT
  • Windows
  • Linux
  • MacOS

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with Stage#mouseMoved and Stage#touchDown, where the viewport-boundary check is shown in the issue. Verify the upper-bound condition accepts events at the viewport edge, then reproduce the HTML/GWT case by moving along the Stage’s upper bound and confirm both mouseMove and touchDown are handled.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
game-dev
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
50/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.