[josm-dev] [PATCH] regression in JOSM's tile drawing

Dave Hansen dave at sr71.net
Sat Aug 20 21:22:49 BST 2011


I'm seeing some regressions in the imagery portion of JOSM.  It does not
seem to be drawing tiles from the non-current zoom level.  It used to do
this.  To reproduce:

1. Load an imagery layer
2. Turn off autozoom
3. Zoom out.  As soon as the autozoom changes, you get a blank screen
   instead of the tiles that were loaded at other zoom levels.

The basic problem here is that paintTileImages() is assuming that
tileSet.allTiles() will actually return all tiles. :)  In practice it
only returns tiles which already exist in the cache.  This was OK before
since it was inefficient and we just looped around all the levels.

But, now, it tries to be really smart with the missedTiles list.
However, since tileSet.allTiles() only returns _cached_ files, it skips
over quite a few tiles.  To fix this, I've decided to have
paintTileImages() unconditionally instantiate all tiles in a tileSet.
This is slow with large sets so I also included an optimization to skip
this instantiation on tile sets with no loaded tiles.

Thoughts?  A patch to fix this is attached.

Note this includes some other tweaks that I posted to the josm-dev@
list.

-- Dave
-------------- next part --------------
A non-text attachment was scrubbed...
Name: josm1.patch
Type: text/x-patch
Size: 3735 bytes
Desc: not available
URL: <http://lists.openstreetmap.org/pipermail/josm-dev/attachments/20110820/5a6c876f/attachment.bin>


More information about the josm-dev mailing list