Changeset 8085 in josm for trunk/src/org/openstreetmap/josm/gui/mappaint/NodeElemStyle.java
- Timestamp:
- 2015-02-18T23:43:28+01:00 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/mappaint/NodeElemStyle.java
r7864 r8085 148 148 int height = heightF == null ? -1 : Math.round(heightF); 149 149 150 float offsetXF = 0f; 151 float offsetYF = 0f; 152 if (keys[ICON_OFFSET_X_IDX] != null) { 153 offsetXF = c.get(keys[ICON_OFFSET_X_IDX], 0f, Float.class); 154 offsetYF = c.get(keys[ICON_OFFSET_Y_IDX], 0f, Float.class); 155 } 156 150 157 final MapImage mapImage = new MapImage(iconRef.iconName, iconRef.source); 151 158 152 159 mapImage.width = width; 153 160 mapImage.height = height; 161 mapImage.offsetX = Math.round(offsetXF); 162 mapImage.offsetY = Math.round(offsetYF); 154 163 155 164 mapImage.alpha = Math.min(255, Math.max(0, Integer.valueOf(Main.pref.getInteger("mappaint.icon-image-alpha", 255)))); … … 246 255 Node n = (Node) primitive; 247 256 if (mapImage != null && painter.isShowIcons()) { 248 final Image nodeIcon; 249 if (painter.isInactiveMode() || n.isDisabled()) { 250 if (disabledNodeIcon == null || disabledNodeIconIsTemporary) { 251 disabledNodeIcon = mapImage.getDisplayedNodeIcon(true); 252 disabledNodeIconIsTemporary = mapImage.isTemporary(); 253 } 254 nodeIcon = disabledNodeIcon; 255 } else { 256 if (enabledNodeIcon == null || enabledNodeIconIsTemporary) { 257 enabledNodeIcon = mapImage.getDisplayedNodeIcon(false); 258 enabledNodeIconIsTemporary = mapImage.isTemporary(); 259 } 260 nodeIcon = enabledNodeIcon; 261 } 262 painter.drawNodeIcon(n, nodeIcon, Utils.color_int2float(mapImage.alpha), selected, member); 257 painter.drawNodeIcon(n, mapImage, painter.isInactiveMode() || n.isDisabled(), selected, member); 263 258 } else if (symbol != null) { 264 259 Color fillColor = symbol.fillColor; … … 321 316 } 322 317 } else if (primitive instanceof Relation && mapImage != null) { 323 painter.drawRestriction((Relation) primitive, mapImage); 318 painter.drawRestriction((Relation) primitive, mapImage, painter.isInactiveMode() || primitive.isDisabled()); 324 319 } 325 320 }
Note:
See TracChangeset
for help on using the changeset viewer.
