Skip to content
This repository has been archived by the owner on Jun 24, 2021. It is now read-only.

WIP: synchronize sceneState on scale-factor change #99

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ public void setPixelScaleFactors(float scalex, float scaley) {
renderScaleX = scalex;
renderScaleY = scaley;
entireSceneNeedsRepaint();
sceneState.update();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not thread-safe. This method must only be called on the JavaFX event thread, and with the render lock held. You will need a different solution to the problem you are trying to solve.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok I see in SWT this is called from the correct Thread but in Swing is is called from EDT. The problem is that sceneState update is ONLY called when the scene is dirty and there's not even internal API to call.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

even if called on the correct thread it will need the renderlock, and I don't know if this is an OK place to acquire that lock (it might be, but that would need to be explored).

}

public float getRenderScaleX() {
Expand Down