Skip to content

Conversation

@codex128
Copy link
Contributor

@codex128 codex128 commented Aug 6, 2025

This fixes addControlAt in Spatial awkwardly repositioning the control to add after calling addControl to do "bookkeeping". addControl now delegates everything to addControlAt.

@codex128 codex128 changed the title Fix addControlAt Fixes addControlAt Aug 6, 2025
@github-actions
Copy link

github-actions bot commented Aug 6, 2025

🖼️ Screenshot tests have failed.

The purpose of these tests is to ensure that changes introduced in this PR don't break visual features. They are visual unit tests.

📄 Where to find the report:

  • Go to the (failed run) > Summary > Artifacts > screenshot-test-report
  • Download the zip and open jme3-screenshot-tests/build/reports/ScreenshotDiffReport.html

⚠️ If you didn't expect to change anything visual:
Fix your changes so the screenshot tests pass.

If you did mean to change things:
Review the replacement images in jme3-screenshot-tests/build/changed-images to make sure they really are improvements and then replace and commit the replacement images at jme3-screenshot-tests/src/test/resources.

If you are creating entirely new tests:
Find the new images in jme3-screenshot-tests/build/changed-images and commit the new images at jme3-screenshot-tests/src/test/resources.

Note; it is very important that the committed reference images are created on the build pipeline, locally created images are not reliable. Similarly tests will fail locally but you can look at the report to check they are "visually similar".

See https://github.com/jMonkeyEngine/jmonkeyengine/blob/master/jme3-screenshot-tests/README.md for more information

Contact @richardTingle (aka richtea) for guidance if required

@codex128
Copy link
Contributor Author

codex128 commented Aug 7, 2025

Screenshots are failing mostly on PBR tests for some reason (and not with any noticeable differences). This is a change I would not expect screenshots to fail on. @richardTingle would you mind taking a look?

@richardTingle
Copy link
Member

Hmm, this does seem really weird. I'm at work currently but I'll take a look at it after that

@richardTingle
Copy link
Member

Ok, I understand the problem. I use mesa, libgl1 and Xvfb to do CPU openGL rendering. And the pipeline just grabs the most recent one, and the whole thing is very sensitive to exact implementations to be pixel identical. I think one of these has released a new version.

What I need to do is create a docker container to effectively pin this so we can have a stable version. I'm going to do that now but are you blocked by this (there would be quicker ways to unblock you if needs be)

@riccardobl
Copy link
Member

riccardobl commented Aug 7, 2025

I think this is potentially a breaking change.
addControl is not final, so it can be overriden.
In the current code addControlAt calls addControl so if you override addControl this affects also addControlAt.
This change flips the flow, so that you need to override addControlAt to get the same behavior.

imo if not broken, it is better to not touch this, or if you really want to do this, we need to look into the engine to be sure there are no side effects

@codex128
Copy link
Contributor Author

codex128 commented Aug 7, 2025

In the current code addControlAt calls addControl so if you override addControl this affects also addControlAt. This change flips the flow, so that you need to override addControlAt to get the same behavior.

Good point. That's a bummer because addControlAt is inefficient and the validation checks are different between the two methods, but I'm not willing to put in the extra effort for it.

I'm going to close this.

@codex128 codex128 closed this Aug 7, 2025
@richardTingle
Copy link
Member

Probably no longer relevant but for the purposes of linking everything together: this is the screenshot test fix: #2542

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants