Ignore:
Timestamp:
2016-08-04T22:38:02+02:00 (8 years ago)
Author:
simon04
Message:

fix #13276 - icon flashes when zooming

Do never load local images asynchronously.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/tools/ImageProvider.java

    r10714 r10731  
    635635     */
    636636    public CompletableFuture<ImageIcon> getAsync() {
    637         return CompletableFuture.supplyAsync(this::get, IMAGE_FETCHER);
     637        return name.startsWith(HTTP_PROTOCOL) || name.startsWith(WIKI_PROTOCOL)
     638                ? CompletableFuture.supplyAsync(this::get, IMAGE_FETCHER)
     639                : CompletableFuture.completedFuture(get());
    638640    }
    639641
     
    676678     * @since 10714
    677679     */
    678      public CompletableFuture<ImageResource> getResourceAsync() {
    679         return CompletableFuture.supplyAsync(this::getResource, IMAGE_FETCHER);
     680    public CompletableFuture<ImageResource> getResourceAsync() {
     681        return name.startsWith(HTTP_PROTOCOL) || name.startsWith(WIKI_PROTOCOL)
     682                ? CompletableFuture.supplyAsync(this::getResource, IMAGE_FETCHER)
     683                : CompletableFuture.completedFuture(getResource());
    680684    }
    681685
Note: See TracChangeset for help on using the changeset viewer.