Index: /trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/StyledMapRenderer.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/StyledMapRenderer.java	(revision 11757)
+++ /trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/StyledMapRenderer.java	(revision 11758)
@@ -61,4 +61,8 @@
 import org.openstreetmap.josm.data.osm.visitor.paint.relations.Multipolygon.PolyData;
 import org.openstreetmap.josm.data.osm.visitor.paint.relations.MultipolygonCache;
+import org.openstreetmap.josm.data.preferences.AbstractProperty;
+import org.openstreetmap.josm.data.preferences.BooleanProperty;
+import org.openstreetmap.josm.data.preferences.IntegerProperty;
+import org.openstreetmap.josm.data.preferences.StringProperty;
 import org.openstreetmap.josm.gui.MapViewState.MapViewPoint;
 import org.openstreetmap.josm.gui.NavigatableComponent;
@@ -263,12 +267,31 @@
     private static final double cosPHI = Math.cos(PHI);
     private static final double sinPHI = Math.sin(PHI);
+    /**
+     * If we should use left hand traffic.
+     */
+    private static final AbstractProperty<Boolean> PREFERENCE_LEFT_HAND_TRAFFIC
+            = new BooleanProperty("mappaint.lefthandtraffic", false).cached();
+    /**
+     * Indicates that the renderer should enable anti-aliasing
+     * @since 11758
+     */
+    public static final AbstractProperty<Boolean> PREFERENCE_ANTIALIASING_USE
+            = new BooleanProperty("mappaint.use-antialiasing", true).cached();
+    /**
+     * The mode that is used for anti-aliasing
+     * @since 11758
+     */
+    public static final AbstractProperty<String> PREFERENCE_TEXT_ANTIALIASING
+            = new StringProperty("mappaint.text-antialiasing", "default").cached();
+
+    /**
+     * The line with to use for highlighting
+     */
+    private static final AbstractProperty<Integer> HIGHLIGHT_LINE_WIDTH = new IntegerProperty("mappaint.highlight.width", 4).cached();
+    private static final AbstractProperty<Integer> HIGHLIGHT_POINT_RADIUS = new IntegerProperty("mappaint.highlight.radius", 7).cached();
+    private static final AbstractProperty<Integer> WIDER_HIGHLIGHT = new IntegerProperty("mappaint.highlight.bigger-increment", 5).cached();
+    private static final AbstractProperty<Integer> HIGHLIGHT_STEP = new IntegerProperty("mappaint.highlight.step", 4).cached();
 
     private Collection<WaySegment> highlightWaySegments;
-
-    // highlight customization fields
-    private int highlightLineWidth;
-    private int highlightPointRadius;
-    private int widerHighlight;
-    private int highlightStep;
 
     //flag that activate wider highlight mode
@@ -783,5 +806,5 @@
     /**
      * highlights a given GeneralPath using the settings from BasicStroke to match the line's
-     * style. Width of the highlight is hard coded.
+     * style. Width of the highlight can be changed by user preferences
      * @param path path to draw
      * @param line line style
@@ -791,10 +814,13 @@
             return;
         g.setColor(highlightColorTransparent);
-        float w = line.getLineWidth() + highlightLineWidth;
-        if (useWiderHighlight) w += widerHighlight;
+        float w = line.getLineWidth() + HIGHLIGHT_LINE_WIDTH.get();
+        if (useWiderHighlight) {
+            w += WIDER_HIGHLIGHT.get();
+        }
+        int step = Math.max(HIGHLIGHT_STEP.get(), 1);
         while (w >= line.getLineWidth()) {
             g.setStroke(new BasicStroke(w, line.getEndCap(), line.getLineJoin(), line.getMiterLimit()));
             g.draw(path);
-            w -= highlightStep;
+            w -= step;
         }
     }
@@ -808,10 +834,13 @@
     private void drawPointHighlight(Point2D p, int size) {
         g.setColor(highlightColorTransparent);
-        int s = size + highlightPointRadius;
-        if (useWiderHighlight) s += widerHighlight;
+        int s = size + HIGHLIGHT_POINT_RADIUS.get();
+        if (useWiderHighlight) {
+            s += WIDER_HIGHLIGHT.get();
+        }
+        int step = Math.max(HIGHLIGHT_STEP.get(), 1);
         while (s >= size) {
             int r = (int) Math.floor(s/2d);
             g.fill(new RoundRectangle2D.Double(p.getX()-r, p.getY()-r, s, s, r, r));
-            s -= highlightStep;
+            s -= step;
         }
     }
@@ -1041,7 +1070,14 @@
     private void displayText(OsmPrimitive osm, TextLabel text, String name, Rectangle2D nb,
             MapViewPositionAndRotation center) {
-        AffineTransform at = AffineTransform.getTranslateInstance(center.getPoint().getInViewX(), center.getPoint().getInViewY());
-        at.rotate(center.getRotation());
-        at.translate(-nb.getCenterX(), -nb.getCenterY());
+        AffineTransform at = new AffineTransform();
+        if (Math.abs(center.getRotation()) < .01) {
+            // Explicitly no rotation: move to full pixels.
+            at.setToTranslation(Math.round(center.getPoint().getInViewX() - nb.getCenterX()),
+                    Math.round(center.getPoint().getInViewY() - nb.getCenterY()));
+        } else {
+            at.setToTranslation(center.getPoint().getInViewX(), center.getPoint().getInViewY());
+            at.rotate(center.getRotation());
+            at.translate(-nb.getCenterX(), -nb.getCenterY());
+        }
         displayText(() -> {
             AffineTransform defaultTransform = g.getTransform();
@@ -1261,5 +1297,5 @@
         scale = nc.getScale();
 
-        leftHandTraffic = Main.pref.getBoolean("mappaint.lefthandtraffic", false);
+        leftHandTraffic = PREFERENCE_LEFT_HAND_TRAFFIC.get();
 
         useStrokes = paintSettings.getUseStrokesDistance() > circum;
@@ -1268,10 +1304,10 @@
         isOutlineOnly = paintSettings.isOutlineOnly();
 
-        antialiasing = Main.pref.getBoolean("mappaint.use-antialiasing", true) ?
+        antialiasing = PREFERENCE_ANTIALIASING_USE.get() ?
                         RenderingHints.VALUE_ANTIALIAS_ON : RenderingHints.VALUE_ANTIALIAS_OFF;
         g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, antialiasing);
 
         Object textAntialiasing;
-        switch (Main.pref.get("mappaint.text-antialiasing", "default")) {
+        switch (PREFERENCE_TEXT_ANTIALIASING.get()) {
             case "on":
                 textAntialiasing = RenderingHints.VALUE_TEXT_ANTIALIAS_ON;
@@ -1299,9 +1335,4 @@
         }
         g.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, textAntialiasing);
-
-        highlightLineWidth = Main.pref.getInteger("mappaint.highlight.width", 4);
-        highlightPointRadius = Main.pref.getInteger("mappaint.highlight.radius", 7);
-        widerHighlight = Main.pref.getInteger("mappaint.highlight.bigger-increment", 5);
-        highlightStep = Main.pref.getInteger("mappaint.highlight.step", 4);
     }
 
