Index: trunk/src/org/openstreetmap/josm/data/coor/QuadTiling.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/coor/QuadTiling.java	(revision 4318)
+++ trunk/src/org/openstreetmap/josm/data/coor/QuadTiling.java	(revision 4319)
@@ -4,14 +4,14 @@
 public class QuadTiling
 {
-    public static int NR_LEVELS = 24;
-    public static double WORLD_PARTS = (1 << NR_LEVELS);
+    public static final int NR_LEVELS = 24;
+    public static final double WORLD_PARTS = (1 << NR_LEVELS);
 
-    public static int TILES_PER_LEVEL_SHIFT = 2; // Has to be 2. Other parts of QuadBuckets code rely on it
-    public static int TILES_PER_LEVEL = 1<<TILES_PER_LEVEL_SHIFT;
-    static public int X_PARTS = 360;
-    static public int X_BIAS = -180;
+    public static final int TILES_PER_LEVEL_SHIFT = 2; // Has to be 2. Other parts of QuadBuckets code rely on it
+    public static final int TILES_PER_LEVEL = 1<<TILES_PER_LEVEL_SHIFT;
+    static public final int X_PARTS = 360;
+    static public final int X_BIAS = -180;
 
-    static public int Y_PARTS = 180;
-    static public int Y_BIAS = -90;
+    static public final int Y_PARTS = 180;
+    static public final int Y_BIAS = -90;
 
     public static LatLon tile2LatLon(long quad)
Index: trunk/src/org/openstreetmap/josm/data/osm/BBox.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/osm/BBox.java	(revision 4318)
+++ trunk/src/org/openstreetmap/josm/data/osm/BBox.java	(revision 4319)
@@ -136,5 +136,5 @@
     /**
      * Tests, weather two BBoxes intersect as an area.
-     * I.e. weather there exists a point that lies in both of them.
+     * I.e. whether there exists a point that lies in both of them.
      */
     public boolean intersects(BBox b) {
Index: trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/MapPainter.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/MapPainter.java	(revision 4318)
+++ trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/MapPainter.java	(revision 4319)
@@ -38,9 +38,9 @@
 import org.openstreetmap.josm.data.osm.visitor.paint.relations.Multipolygon.PolyData;
 import org.openstreetmap.josm.gui.NavigatableComponent;
+import org.openstreetmap.josm.gui.mappaint.BoxTextElemStyle;
+import org.openstreetmap.josm.gui.mappaint.BoxTextElemStyle.HorizontalTextAlignment;
+import org.openstreetmap.josm.gui.mappaint.BoxTextElemStyle.VerticalTextAlignment;
 import org.openstreetmap.josm.gui.mappaint.NodeElemStyle;
-import org.openstreetmap.josm.gui.mappaint.NodeElemStyle.HorizontalTextAlignment;
-import org.openstreetmap.josm.gui.mappaint.NodeElemStyle.NodeTextElement;
 import org.openstreetmap.josm.gui.mappaint.NodeElemStyle.Symbol;
-import org.openstreetmap.josm.gui.mappaint.NodeElemStyle.VerticalTextAlignment;
 import org.openstreetmap.josm.gui.mappaint.TextElement;
 import org.openstreetmap.josm.tools.ImageProvider;
@@ -496,5 +496,5 @@
     }
 
-    public void drawNodeIcon(Node n, ImageIcon icon, float iconAlpha, boolean selected, boolean member, NodeTextElement text) {
+    public void drawNodeIcon(Node n, ImageIcon icon, float iconAlpha, boolean selected, boolean member) {
         Point p = nc.getPoint(n);
         if ((p.x < 0) || (p.y < 0) || (p.x > nc.getWidth()) || (p.y > nc.getHeight())) return;
@@ -506,5 +506,4 @@
         icon.paintIcon ( nc, g, p.x-w/2, p.y-h/2 );
         g.setPaintMode();
-        drawNodeText(n, text, p, w/2, h/2);
         if (selected || member)
         {
@@ -529,5 +528,5 @@
     }
 
-    public void drawNodeSymbol(Node n, Symbol s, Color fillColor, Color strokeColor, NodeTextElement text) {
+    public void drawNodeSymbol(Node n, Symbol s, Color fillColor, Color strokeColor) {
         Point p = nc.getPoint(n);
         if ((p.x < 0) || (p.y < 0) || (p.x > nc.getWidth()) || (p.y > nc.getHeight())) return;
@@ -604,5 +603,4 @@
             g.setStroke(new BasicStroke());
         }
-        drawNodeText(n, text, p, radius, radius);
     }
 
@@ -613,5 +611,5 @@
      * @param color The color of the node.
      */
-    public void drawNode(Node n, Color color, int size, boolean fill, NodeTextElement text) {
+    public void drawNode(Node n, Color color, int size, boolean fill) {
         if (size > 1) {
             Point p = nc.getPoint(n);
@@ -629,17 +627,13 @@
                 g.drawRect(p.x - radius, p.y - radius, size, size);
             }
-
-            drawNodeText(n, text, p, radius, radius + 4);
-        }
-    }
-
-    private void drawNodeText(Node n, NodeTextElement text, Point p, int w_half, int h_half) {
-        if (!isShowNames() || text == null)
+        }
+    }
+
+    public void drawBoxText(Node n, BoxTextElemStyle bs) {
+        if (!isShowNames() || bs == null)
             return;
-
-        /*
-         * abort if we can't compose the label to be rendered
-         */
-        if (text.labelCompositionStrategy == null) return;
+        
+        Point p = nc.getPoint((Node) n);
+        TextElement text = bs.text;
         String s = text.labelCompositionStrategy.compose(n);
         if (s == null) return;
@@ -661,30 +655,30 @@
          *
          */
-        if (text.hAlign == HorizontalTextAlignment.RIGHT) {
-            x += w_half + 2;
+        if (bs.hAlign == HorizontalTextAlignment.RIGHT) {
+            x += bs.box.x + bs.box.width + 2;
         } else {
             FontRenderContext frc = g.getFontRenderContext();
             Rectangle2D bounds = text.font.getStringBounds(s, frc);
             int textWidth = (int) bounds.getWidth();
-            if (text.hAlign == HorizontalTextAlignment.CENTER) {
+            if (bs.hAlign == HorizontalTextAlignment.CENTER) {
                 x -= textWidth / 2;
-            } else if (text.hAlign == HorizontalTextAlignment.LEFT) {
-                x -= w_half + 4 + textWidth;
+            } else if (bs.hAlign == HorizontalTextAlignment.LEFT) {
+                x -= - bs.box.x + 4 + textWidth;
             } else throw new AssertionError();
         }
 
-        if (text.vAlign == VerticalTextAlignment.BOTTOM) {
-            y += h_half - 2;
+        if (bs.vAlign == VerticalTextAlignment.BOTTOM) {
+            y += bs.box.y + bs.box.height;
         } else {
             FontRenderContext frc = g.getFontRenderContext();
             LineMetrics metrics = text.font.getLineMetrics(s, frc);
-            if (text.vAlign == VerticalTextAlignment.ABOVE) {
-                y -= h_half + metrics.getDescent();
-            } else if (text.vAlign == VerticalTextAlignment.TOP) {
-                y -= h_half - metrics.getAscent();
-            } else if (text.vAlign == VerticalTextAlignment.CENTER) {
+            if (bs.vAlign == VerticalTextAlignment.ABOVE) {
+                y -= - bs.box.y + metrics.getDescent();
+            } else if (bs.vAlign == VerticalTextAlignment.TOP) {
+                y -= - bs.box.y - metrics.getAscent();
+            } else if (bs.vAlign == VerticalTextAlignment.CENTER) {
                 y += (metrics.getAscent() - metrics.getDescent()) / 2;
-            } else if (text.vAlign == VerticalTextAlignment.BELOW) {
-                y += h_half + metrics.getAscent() + 2;
+            } else if (bs.vAlign == VerticalTextAlignment.BELOW) {
+                y += bs.box.y + bs.box.height + metrics.getAscent() + 2;
             } else throw new AssertionError();
         }
Index: trunk/src/org/openstreetmap/josm/gui/mappaint/BoxTextElemStyle.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/mappaint/BoxTextElemStyle.java	(revision 4319)
+++ trunk/src/org/openstreetmap/josm/gui/mappaint/BoxTextElemStyle.java	(revision 4319)
@@ -0,0 +1,138 @@
+// License: GPL. For details, see LICENSE file.
+package org.openstreetmap.josm.gui.mappaint;
+
+import java.awt.Color;
+import static org.openstreetmap.josm.tools.Utils.equal;
+
+import java.awt.Rectangle;
+import org.openstreetmap.josm.data.osm.Node;
+import org.openstreetmap.josm.data.osm.OsmPrimitive;
+import org.openstreetmap.josm.data.osm.visitor.paint.MapPaintSettings;
+import org.openstreetmap.josm.data.osm.visitor.paint.MapPainter;
+import org.openstreetmap.josm.data.osm.visitor.paint.PaintColors;
+
+import org.openstreetmap.josm.tools.CheckParameterUtil;
+
+/**
+ * Text style attached to a style with a bounding box, like an icon or a symbol.
+ */
+public class BoxTextElemStyle extends ElemStyle {
+
+    public enum HorizontalTextAlignment { LEFT, CENTER, RIGHT }
+    public enum VerticalTextAlignment { ABOVE, TOP, CENTER, BOTTOM, BELOW }
+    
+    public static Rectangle ZERO_BOX = new Rectangle(0, 0, 0, 0);
+    
+    public TextElement text;
+    public Rectangle box;
+    public HorizontalTextAlignment hAlign;
+    public VerticalTextAlignment vAlign;
+
+    public BoxTextElemStyle(Cascade c, TextElement text, Rectangle box, HorizontalTextAlignment hAlign, VerticalTextAlignment vAlign) {
+        super(c, 2000f);
+        CheckParameterUtil.ensureParameterNotNull(text);
+        CheckParameterUtil.ensureParameterNotNull(hAlign);
+        CheckParameterUtil.ensureParameterNotNull(vAlign);
+        this.text = text;
+        this.box = box == null ? ZERO_BOX : box;
+        this.hAlign = hAlign;
+        this.vAlign = vAlign;
+    }
+    
+    public static BoxTextElemStyle create(Environment env, Rectangle box) {
+        initDefaultParameters();
+        Cascade c = env.mc.getCascade(env.layer);
+
+        TextElement text = TextElement.create(c, DEFAULT_TEXT_COLOR, false);
+        if (text == null) return null;
+        // Skip any primtives that don't have text to draw. (Styles are recreated for any tag change.)
+        // The concrete text to render is not cached in this object, but computed for each
+        // repaint. This way, one BoxTextElemStyle object can be used by multiple primitives (to save memory).
+        if (text.labelCompositionStrategy.compose(env.osm) == null) return null;
+
+        HorizontalTextAlignment hAlign = HorizontalTextAlignment.RIGHT;
+        Keyword hAlignKW = c.get("text-anchor-horizontal", Keyword.RIGHT, Keyword.class);
+        if (equal(hAlignKW.val, "left")) {
+            hAlign = HorizontalTextAlignment.LEFT;
+        } else if (equal(hAlignKW.val, "center")) {
+            hAlign = HorizontalTextAlignment.CENTER;
+        } else if (equal(hAlignKW.val, "right")) {
+            hAlign = HorizontalTextAlignment.RIGHT;
+        }
+        VerticalTextAlignment vAlign = VerticalTextAlignment.BOTTOM;
+        String vAlignStr = c.get("text-anchor-vertical", Keyword.BOTTOM, Keyword.class).val;
+        if (equal(vAlignStr, "above")) {
+            vAlign = VerticalTextAlignment.ABOVE;
+        } else if (equal(vAlignStr, "top")) {
+            vAlign = VerticalTextAlignment.TOP;
+        } else if (equal(vAlignStr, "center")) {
+            vAlign = VerticalTextAlignment.CENTER;
+        } else if (equal(vAlignStr, "bottom")) {
+            vAlign = VerticalTextAlignment.BOTTOM;
+        } else if (equal(vAlignStr, "below")) {
+            vAlign = VerticalTextAlignment.BELOW;
+        }
+        
+        return new BoxTextElemStyle(c, text, box, hAlign, vAlign);
+    }
+    
+    public static final BoxTextElemStyle SIMPLE_NODE_TEXT_ELEMSTYLE;
+    static {
+        MultiCascade mc = new MultiCascade();
+        Cascade c = mc.getOrCreateCascade("default");
+        c.put("text", Keyword.AUTO);
+        Node n = new Node();
+        n.put("name", "dummy");
+        SIMPLE_NODE_TEXT_ELEMSTYLE = create(new Environment(n, mc, "default", null), NodeElemStyle.SIMPLE_NODE_ELEMSTYLE.getBox());
+        if (SIMPLE_NODE_TEXT_ELEMSTYLE == null) throw new AssertionError();
+    }
+    /*
+     * Caches the default text color from the preferences.
+     *
+     * FIXME: the cache isn't updated if the user changes the preference during a JOSM
+     * session. There should be preference listener updating this cache.
+     */
+    static private Color DEFAULT_TEXT_COLOR = null;
+    static private void initDefaultParameters() {
+        if (DEFAULT_TEXT_COLOR != null) return;
+        DEFAULT_TEXT_COLOR = PaintColors.TEXT.get();
+    }
+
+    @Override
+    public void paintPrimitive(OsmPrimitive osm, MapPaintSettings settings, MapPainter painter, boolean selected, boolean member) {
+        if (osm instanceof Node) {
+            painter.drawBoxText((Node) osm, this);
+        }
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (!super.equals(obj)) {
+            return false;
+        }
+        if (obj == null || getClass() != obj.getClass()) {
+            return false;
+        }
+        final BoxTextElemStyle other = (BoxTextElemStyle) obj;
+        return text.equals(other.text) &&
+                box.equals(other.box) && 
+                hAlign == other.hAlign && 
+                vAlign == other.vAlign;
+    }
+
+    @Override
+    public int hashCode() {
+        int hash = super.hashCode();
+        hash = 97 * hash + text.hashCode();
+        hash = 97 * hash + box.hashCode();
+        hash = 97 * hash + hAlign.hashCode();
+        hash = 97 * hash + vAlign.hashCode();
+        return hash;
+    }
+
+    @Override
+    public String toString() {
+        return "BoxTextElemStyle{" + super.toString() + " " + text.toStringImpl() + " box=" + box + " hAlign=" + hAlign + " vAlign=" + vAlign + '}';
+    }
+
+}
Index: trunk/src/org/openstreetmap/josm/gui/mappaint/ElemStyles.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/mappaint/ElemStyles.java	(revision 4318)
+++ trunk/src/org/openstreetmap/josm/gui/mappaint/ElemStyles.java	(revision 4319)
@@ -79,4 +79,7 @@
             if (!hasNonModifier) {
                 p.a = new StyleList(p.a, NodeElemStyle.SIMPLE_NODE_ELEMSTYLE);
+                if (BoxTextElemStyle.SIMPLE_NODE_TEXT_ELEMSTYLE.text.labelCompositionStrategy.compose(osm) != null) {
+                    p.a = new StyleList(p.a, BoxTextElemStyle.SIMPLE_NODE_TEXT_ELEMSTYLE);
+                }
             }
         } else if (osm instanceof Way && isDefaultLines()) {
@@ -301,5 +304,9 @@
                 addIfNotNull(sl, LineTextElemStyle.create(env));
             } else if (osm instanceof Node) {
-                addIfNotNull(sl, NodeElemStyle.create(env));
+                NodeElemStyle nodeStyle = NodeElemStyle.create(env);
+                if (nodeStyle != null) {
+                    sl.add(nodeStyle);
+                    addIfNotNull(sl, BoxTextElemStyle.create(env, nodeStyle.getBox()));
+                }
             } else if (osm instanceof Relation) {
                 if (((Relation)osm).isMultipolygon()) {
Index: trunk/src/org/openstreetmap/josm/gui/mappaint/NodeElemStyle.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/mappaint/NodeElemStyle.java	(revision 4318)
+++ trunk/src/org/openstreetmap/josm/gui/mappaint/NodeElemStyle.java	(revision 4319)
@@ -6,6 +6,5 @@
 import java.awt.BasicStroke;
 import java.awt.Color;
-import java.awt.Dimension;
-import java.awt.Image;
+import java.awt.Rectangle;
 import java.awt.Stroke;
 
@@ -19,7 +18,5 @@
 import org.openstreetmap.josm.data.osm.visitor.paint.MapPaintSettings;
 import org.openstreetmap.josm.data.osm.visitor.paint.MapPainter;
-import org.openstreetmap.josm.data.osm.visitor.paint.PaintColors;
 import org.openstreetmap.josm.gui.mappaint.MapPaintStyles.IconReference;
-import org.openstreetmap.josm.tools.CheckParameterUtil;
 import org.openstreetmap.josm.tools.Pair;
 import org.openstreetmap.josm.tools.Utils;
@@ -32,11 +29,8 @@
     public int iconAlpha;
     public Symbol symbol;
-    public NodeTextElement text;
 
     private ImageIcon disabledIcon;
 
     public enum SymbolShape { SQUARE, CIRCLE, TRIANGLE, PENTAGON, HEXAGON, HEPTAGON, OCTAGON, NONAGON, DECAGON }
-    public enum HorizontalTextAlignment { LEFT, CENTER, RIGHT }
-    public enum VerticalTextAlignment { ABOVE, TOP, CENTER, BOTTOM, BELOW }
 
     public static class Symbol {
@@ -90,60 +84,17 @@
     }
 
-    public static class NodeTextElement extends TextElement {
-        public HorizontalTextAlignment hAlign;
-        public VerticalTextAlignment vAlign;
-
-        public NodeTextElement(TextElement text, HorizontalTextAlignment hAlign, VerticalTextAlignment vAlign) {
-            super(text);
-            CheckParameterUtil.ensureParameterNotNull(hAlign);
-            CheckParameterUtil.ensureParameterNotNull(vAlign);
-            this.hAlign = hAlign;
-            this.vAlign = vAlign;
-        }
-
-        @Override
-        public boolean equals(Object obj) {
-            if (!super.equals(obj))
-                return false;
-            if (obj == null || getClass() != obj.getClass())
-                return false;
-            final NodeTextElement other = (NodeTextElement) obj;
-            return hAlign == other.hAlign &&
-                    vAlign == other.vAlign;
-        }
-
-        @Override
-        public int hashCode() {
-            int hash = super.hashCode();
-            hash = 97 * hash + hAlign.hashCode();
-            hash = 97 * hash + vAlign.hashCode();
-            return hash;
-        }
-
-        @Override
-        public String toString() {
-            return "NodeTextElement{" + toStringImpl() + '}';
-        }
-
-        @Override
-        protected String toStringImpl() {
-            return super.toStringImpl() + " hAlign=" + hAlign + " vAlign=" + vAlign;
-        }
-    }
-
     public static final NodeElemStyle SIMPLE_NODE_ELEMSTYLE;
     static {
         MultiCascade mc = new MultiCascade();
         Cascade c = mc.getOrCreateCascade("default");
-        c.put("text", Keyword.AUTO);
         SIMPLE_NODE_ELEMSTYLE = create(new Environment(null, mc, "default", null), true);
-    }
-
-    protected NodeElemStyle(Cascade c, ImageIcon icon, Integer iconAlpha, Symbol symbol, NodeTextElement text) {
+        if (SIMPLE_NODE_ELEMSTYLE == null) throw new AssertionError();
+    }
+
+    protected NodeElemStyle(Cascade c, ImageIcon icon, Integer iconAlpha, Symbol symbol) {
         super(c, 1000f);
         this.icon = icon;
         this.iconAlpha = iconAlpha == null ? 0 : iconAlpha;
         this.symbol = symbol;
-        this.text = text;
     }
 
@@ -152,18 +103,5 @@
     }
 
-    /*
-     * Caches the default text color from the preferences.
-     *
-     * FIXME: the cache isn't updated if the user changes the preference during a JOSM
-     * session. There should be preference listener updating this cache.
-     */
-    static private Color DEFAULT_TEXT_COLOR = null;
-    static private void initDefaultParameters() {
-        if (DEFAULT_TEXT_COLOR != null) return;
-        DEFAULT_TEXT_COLOR = PaintColors.TEXT.get();
-    }
-
     private static NodeElemStyle create(Environment env, boolean allowDefault) {
-        initDefaultParameters();
         Cascade c = env.mc.getCascade(env.layer);
 
@@ -173,43 +111,14 @@
             symbol = createSymbol(env);
         }
-
-        NodeTextElement text = null;
-        TextElement te = TextElement.create(c, DEFAULT_TEXT_COLOR, symbol == null && icon == null && allowDefault);
-        // optimization: if we neither have a symbol, nor an icon, nor a text element
+        
+        // optimization: if we neither have a symbol, nor an icon
         // we don't have to check for the remaining style properties and we don't
         // have to allocate a node element style.
-        if (symbol == null && icon == null && te == null) return null;
-
-        if (te != null) {
-            HorizontalTextAlignment hAlign = HorizontalTextAlignment.RIGHT;
-            Keyword hAlignKW = c.get("text-anchor-horizontal", Keyword.RIGHT, Keyword.class);
-            if (equal(hAlignKW.val, "left")) {
-                hAlign = HorizontalTextAlignment.LEFT;
-            } else if (equal(hAlignKW.val, "center")) {
-                hAlign = HorizontalTextAlignment.CENTER;
-            } else if (equal(hAlignKW.val, "right")) {
-                hAlign = HorizontalTextAlignment.RIGHT;
-            }
-            VerticalTextAlignment vAlign = VerticalTextAlignment.BOTTOM;
-            String vAlignStr = c.get("text-anchor-vertical", Keyword.BOTTOM, Keyword.class).val;
-            if (equal(vAlignStr, "above")) {
-                vAlign = VerticalTextAlignment.ABOVE;
-            } else if (equal(vAlignStr, "top")) {
-                vAlign = VerticalTextAlignment.TOP;
-            } else if (equal(vAlignStr, "center")) {
-                vAlign = VerticalTextAlignment.CENTER;
-            } else if (equal(vAlignStr, "bottom")) {
-                vAlign = VerticalTextAlignment.BOTTOM;
-            } else if (equal(vAlignStr, "below")) {
-                vAlign = VerticalTextAlignment.BELOW;
-            }
-            text = new NodeTextElement(te, hAlign, vAlign);
-        }
+        if (!allowDefault && symbol == null && icon == null) return null;
 
         return new NodeElemStyle(c,
                 icon == null ? null : icon.a,
                 icon == null ? null : icon.b,
-                symbol,
-                text);
+                symbol);
     }
 
@@ -330,5 +239,5 @@
             if (icon != null && painter.isShowIcons()) {
                 painter.drawNodeIcon(n, (painter.isInactiveMode() || n.isDisabled()) ? getDisabledIcon() : icon,
-                        Utils.color_int2float(iconAlpha), selected, member, text);
+                        Utils.color_int2float(iconAlpha), selected, member);
             } else if (symbol != null) {
                 Color fillColor = symbol.fillColor;
@@ -360,8 +269,8 @@
                     }
                 }
-                painter.drawNodeSymbol(n, symbol, fillColor, strokeColor, text);
+                painter.drawNodeSymbol(n, symbol, fillColor, strokeColor);
             } else {
                 if (n.isHighlighted()) {
-                    painter.drawNode(n, settings.getHighlightColor(), settings.getSelectedNodeSize(), settings.isFillSelectedNode(), text);
+                    painter.drawNode(n, settings.getHighlightColor(), settings.getSelectedNodeSize(), settings.isFillSelectedNode());
                 } else {
                     Color color;
@@ -398,5 +307,5 @@
                             settings.isFillUnselectedNode();
 
-                    painter.drawNode(n, color, size, fill, text);
+                    painter.drawNode(n, color, size, fill);
                 }
             }
@@ -412,4 +321,23 @@
             return null;
         return disabledIcon = new ImageIcon(GrayFilter.createDisabledImage(icon.getImage()));
+    }
+    
+    public Rectangle getBox() {
+        if (icon != null) {
+            int w = icon.getIconWidth(), h=icon.getIconHeight();
+            return new Rectangle(-w/2, -h/2, w, h);
+        } else if (symbol != null) {
+            return new Rectangle(-symbol.size/2, -symbol.size/2, symbol.size, symbol.size);
+        } else {
+            // This is only executed once, so no performance concerns.
+            // However, it would be better, if the settings could be changed at runtime.
+            int size = Utils.max(
+                    Main.pref.getInteger("mappaint.node.selected-size", 5),
+                    Main.pref.getInteger("mappaint.node.unselected-size", 3),
+                    Main.pref.getInteger("mappaint.node.connection-size", 5),
+                    Main.pref.getInteger("mappaint.node.tagged-size", 3)
+            );
+            return new Rectangle(-size/2, -size/2, size, size);
+        }
     }
 
@@ -420,5 +348,4 @@
         hash = 17 * hash + iconAlpha;
         hash = 17 * hash + (symbol != null ? symbol.hashCode() : 0);
-        hash = 17 * hash + (text != null ? text.hashCode() : 0);
         return hash;
     }
@@ -438,6 +365,4 @@
             return false;
         if (!equal(symbol, other.symbol))
-            return false;
-        if (!equal(text, other.text))
             return false;
         return true;
@@ -455,7 +380,4 @@
             s.append(" symbol=[" + symbol + "]");
         }
-        if (text != null) {
-            s.append(" text=[" + text.toStringImpl() + "]");
-        }
         s.append('}');
         return s.toString();
