Modify ↓
#10014 closed defect (fixed)
[Patch] Add support for canvas{fill-color}, deprecate canvas{background-color}
Reported by: | simon04 | Owned by: | team |
---|---|---|---|
Priority: | normal | Milestone: | 14.05 |
Component: | Core mappaint | Version: | |
Keywords: | mapcss | Cc: | bastiK, skunk@… |
Description
According to https://wiki.osm.org/wiki/MapCSS/0.2#Canvas_properties, the "official" tag for setting the background color using MapCSS is
canvas{ fill-color: #abcdef; }
instead of
canvas{ background-color: #abcdef; }
Therefore, I suggest to support the standard and deprecate the current implementation.
-
src/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSStyleSource.java
diff --git a/src/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSStyleSource.java b/src/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSStyleSource.java index 0855a69..1e30485 100644
a b public class MapCSSStyleSource extends StyleSource { 202 202 203 203 private void loadCanvas() { 204 204 Cascade c = constructSpecial("canvas"); 205 backgroundColorOverride = c.get("background-color", null, Color.class); 205 backgroundColorOverride = c.get("fill-color", null, Color.class); 206 if (backgroundColorOverride == null) { 207 backgroundColorOverride = c.get("background-color", null, Color.class); 208 if (backgroundColorOverride != null) { 209 Main.warn("Detected deprecated canvas{background-color} which will be removed shortly."); 210 } 211 } 206 212 } 207 213 208 214 private Cascade constructSpecial(String type) {
Attachments (0)
Change History (4)
comment:1 by , 10 years ago
comment:4 by , 10 years ago
The background colour of power=pole icons (in the Potlatch2 style) has disappeared! :-(
Note:
See TracTickets
for help on using tickets.
Good idea!