Changeset 7378 in josm for trunk/src


Ignore:
Timestamp:
2014-08-12T11:36:47+02:00 (5 years ago)
Author:
bastiK
Message:

see #10363 - show place=* icons on |z11-

  • special handling for instructions with keword "none" as value: always treat as null value
  • print current zoom level to command line with at --trace debug level
Location:
trunk/src/org/openstreetmap/josm
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/StyledMapRenderer.java

    r7109 r7378  
    7070import org.openstreetmap.josm.gui.mappaint.StyleCache.StyleList;
    7171import org.openstreetmap.josm.gui.mappaint.TextElement;
     72import org.openstreetmap.josm.gui.mappaint.mapcss.Selector;
    7273import org.openstreetmap.josm.tools.CompositeList;
    7374import org.openstreetmap.josm.tools.ImageProvider;
     
    12441245                Main.pref.getBoolean("mappaint.use-antialiasing", true) ?
    12451246                        RenderingHints.VALUE_ANTIALIAS_ON : RenderingHints.VALUE_ANTIALIAS_OFF);
    1246 
     1247           
    12471248        highlightLineWidth = Main.pref.getInteger("mappaint.highlight.width", 4);
    12481249        highlightPointRadius = Main.pref.getInteger("mappaint.highlight.radius", 7);
     
    14881489            List<Way> ways = data.searchWays(bbox);
    14891490            List<Relation> relations = data.searchRelations(bbox);
    1490    
     1491
    14911492            final List<StyleRecord> allStyleElems = new ArrayList<>(nodes.size()+ways.size()+relations.size());
    1492    
     1493
    14931494            ConcurrentTasksHelper helper = new ConcurrentTasksHelper(allStyleElems, data);
    14941495
     
    15061507            }
    15071508
    1508             Collections.sort(allStyleElems);
     1509            Collections.sort(allStyleElems); // TODO: try parallel sort when switching to Java 8
    15091510
    15101511            for (StyleRecord r : allStyleElems) {
     
    15171518                );
    15181519            }
    1519    
     1520
    15201521            if (Main.isTraceEnabled()) {
    15211522                timeFinished = System.currentTimeMillis();
    1522                 System.err.println("; phase 2 (draw): " + (timeFinished - timePhase1) + " ms; total: " + (timeFinished - timeStart) + " ms");
    1523             }
    1524    
     1523                System.err.println("; phase 2 (draw): " + (timeFinished - timePhase1) + " ms; total: " + (timeFinished - timeStart) + " ms" +
     1524                    " (scale: " + circum + " zoom level: " + Selector.GeneralSelector.scale2level(circum) + ")");
     1525            }
     1526
    15251527            drawVirtualNodes(data, bbox);
    15261528        } finally {
  • trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/Instruction.java

    r7069 r7378  
    3636            this.key = key;
    3737            this.isSetInstruction = isSetInstruction;
    38             if (val instanceof LiteralExpression) {
     38            if (val instanceof Keyword) {
     39                if ("none".equals(((Keyword) val).val)) {
     40                    this.val = null;
     41                } else {
     42                    this.val = val;
     43                }
     44            } else if (val instanceof LiteralExpression) {
    3945                Object litValue = ((LiteralExpression) val).evaluate(null);
    4046                if (key.equals(TEXT)) {
  • trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/Selector.java

    r7285 r7378  
    596596            return 2.0 * Math.PI * R / Math.pow(2.0, lvl) / 2.56;
    597597        }
     598       
     599        public static int scale2level(double scale) {
     600            if (scale < 0)
     601                throw new IllegalArgumentException();
     602            return (int) Math.floor(Math.log(2 * Math.PI * R / 2.56 / scale) / Math.log(2));
     603        }
    598604
    599605        @Override
Note: See TracChangeset for help on using the changeset viewer.