[JHV 2.1] Problem with zoom scale display in info bar

Bug #690422 reported by Daniel Mueller
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
JHelioviewer
Fix Released
High
Malte Nuhn
2.0
Fix Released
Undecided
Malte Nuhn

Bug Description

trunk rev. 383:

When I zoom, the zoom scale displayed in the info bar is sometimes not updated correctly - but not always. I don't see the underlying pattern yet. Can anyone confirm this? Could it be related to the new zoom-to-mouse-pointer functionality?

Cheers,
Daniel

Tags: jhv2.1
Revision history for this message
Malte Nuhn (malte.nuhn) wrote :

I had a closer look at this one. From what I can see, the value is only updated, when the renderer has actually new (zoomed) data to display. When zooming out, I first see a "black border" (where the the surrounding data should be display). Only when this "black border" is replaced by the surrounding image data, the zoom value changes.

(This can't be the full story - I just observed some other patterns ...)

However, the component's (ZoomStatusPanel) updateZoomLevel method is called correctly, so the value IS actually refreshed immediately.

The problem seems to be in ZoomController's "getZoom()" method: It only returns the updated (correct) values after "some time".

So to summarize:

Someone with more "renderer knowledge" should have a closer look at ZoomController : getZoom()

Cheers
Malte

Changed in jhelioviewer:
status: New → Confirmed
assignee: nobody → Markus Langenberg (markus-langenberg)
Revision history for this message
Markus Langenberg (markus-langenberg) wrote :

So, I had a closer look at this issue.

In my option, the delay has nothing to do with the view chain. The corresponding change event is fired right away. But when the event reaches the GUI-level, it is passed to the class LayersModel, which starts a new thread to pass the event to all GUI-classes. The scheduling of this thread is left to the virtual machine and the operating system. Thus, it is undetermined.

This also explains Malte's observation that the zoom is updated whenever the decoder is ready - When the decoder is not working any more, the CPU is free and thus probability that the update is scheduled is much higher, because no CPU-demanding thread is pending. I am also quite sure that many other effects can be explained by the scheduling. For example, when zooming while playing a move, the update may have to wait several frames or even by pushed over the edge completely, if more and more short-living threads need to be scheduled. We had a similar problem when trying to move all GUI-updates to the AWT event queue, which simply flooded the queue.

@Malte Are these threads necessary? Passing the change event would be quicker and more reliable without using an additional thread...

Changed in jhelioviewer:
milestone: 2.1.2 → 2.1.3
Changed in jhelioviewer:
milestone: 2.1.3 → 2.1.4
assignee: Markus Langenberg (markus-langenberg) → Malte Nuhn (malte.nuhn)
Changed in jhelioviewer:
milestone: 2.1.4 → 2.1.5
Revision history for this message
Malte Nuhn (malte.nuhn) wrote :

Okay, this was not threading related at all. Here's my commit message that describes what was going on:

--

After calling JHVJP2View's setRegion() it is in general not guaranteed that
getRegion() will just return the newly set region. Instead, JHVJP2View will
return the last region for which all available data was downloaded. The zoom
scale info bar used this "old" information.

This fix adds a method getNewestRegion to JHVJP2View and makes ZoomController
use this new method.

NOTE: The special behavior of JHVJP2View's getRegion() seems to be needed
for JHV: Directly changing getRegion() to always return the newest region
resulted in very awkward JHV behavior.

Changed in jhelioviewer:
status: Confirmed → Fix Committed
Changed in jhelioviewer:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.