Show a newly picked object without moving the cursor

A frame asked for while the last one was being taken, like the one that
ends a load, was drawn and swapped before the earlier frame's swap, so
the window kept the old object until something else redrew it.

Model used: Claude Opus 5.5
This commit is contained in:
piexel committed 2026-10-25 19:39:01 +01:00
1 parent 5204d94ebe
commit 360f38a819
1 file changed
+3 -2
@@ -382,17 +382,18 @@ final class OrbitViewport extends JComponent {
/**
* Until the card is opened, nothing knows whether frames can go into the window; the first picture opens it. A
* frame that should have gone into the window but couldn't isn't tried again right away. A frame for a scene
* replaced meanwhile is never shown.
* replaced meanwhile is never shown. The frame counts as rendering until it is on its way to the screen, so a
* frame asked for while it is taken, like when it ends a load, can't be drawn over it first.
*/
private void finishFrame(OrbitScene frameScene, OrbitCamera frameCamera, ScreenTarget screen, OrbitPicture drawn,
boolean missedScreen, long requestedAtNanos) {
rendering = false;
measureFrameTime(System.nanoTime() - requestedAtNanos);
if (frameScene == scene) {
takePicture(drawn, frameCamera);
paintPicture(drawn);
showInWindow(screen, drawn);
}
rendering = false;
boolean canGoOnScreen = !missedScreen && canvas != null && !canvas.isVisible() && drawsOnScreen();
if (renderAgain || drawn.catchingUp() || canGoOnScreen) {
renderAgain = false;