jMonkeyEngine / jMonkeyEngine/jmonkeyengine

Android: Different UI scaling after upgrading to 3.10.0

Open
#2,931 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Documentation
Dominant language
Java
Stars
4.3k
Forks
1.2k
Avg merge
4d 7h
Merged PRs (30d)
14

Description

This affected my android application. I don't know if it also affects desktop apps.

After upgrading android app from 3.9.0-stable to 3.10.0-beta2

  • Some UI elements were 2 or 3 times the previous size
  • Some UI elements did not appear at all (because their position was now outside the screen)

AI told me this:

// jME 3.10 divides the reported resolution (AppSettings/camera width+height) by the
// display density by default, even though DisplayScaleMode itself defaults to
// "disabled". Our GUI/HUD code assumes those are real framebuffer pixels like every previous
// jME version - request native-pixel mode to restore that 1:1 mapping.

Workaround:
After adding this call it worked OK as previously:

settings.setDisplayScaleMode(AppSettings.DISPLAY_SCALE_NATIVE_PIXELS);

The expected behaviour here is that the layout would work the same as in 3.9.0 without requiring code changes.

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 by tracing AppSettings display scaling and the DISPLAY_SCALE_NATIVE_PIXELS mode, then reproduce the Android upgrade from 3.9.0-stable to 3.10.0-beta2 with the reported UI layout. Compare the reported resolution and display-density handling between versions. Done means existing layouts retain their 3.9.0 sizing and positioning without requiring setDisplayScaleMode(DISPLAY_SCALE_NATIVE_PIXELS).

Written by the indexing model from the issue text.

Assessment

Tech stack
android, java
Domain
mobile
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.