Skip to content

Commit 2a0af66

Browse files
committed
refactor: moved hardcoded default to a constant + README update
1 parent a93c648 commit 2a0af66

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,3 +244,4 @@ the data in `map.osm`.
244244
- Geometry simplification
245245
- Data download informed by the style sheet
246246
- Layering support with `layer` tag
247+
- Allow exporting OSM, MapStyle, and CompiledMap objects to XML

freepapermaps/src/main/java/io/github/mrmaxguns/freepapermaps/rendering/CompiledNodeShape.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88

99

1010
public class CompiledNodeShape extends CompiledGeometry {
11-
public static final float DEFAULT_STROKE_WIDTH = 2;
11+
public static final Stroke DEFAULT_STROKE_PROPERTIES = new BasicStroke(2, BasicStroke.CAP_SQUARE,
12+
BasicStroke.JOIN_MITER);
1213
public static final Color DEFAULT_FILL = Color.GREEN;
1314
private final ProjectedCoordinate position;
1415
private final NodeShapeLayer style;
@@ -47,7 +48,7 @@ public void render(Graphics2D g2d, Scaler scaler) {
4748
if (style.getStrokeProperties() != null) {
4849
g2d.setStroke(style.getStrokeProperties());
4950
} else {
50-
g2d.setStroke(new BasicStroke(DEFAULT_STROKE_WIDTH, BasicStroke.CAP_SQUARE, BasicStroke.JOIN_MITER));
51+
g2d.setStroke(DEFAULT_STROKE_PROPERTIES);
5152
}
5253

5354
// If there is a fill, do that first

0 commit comments

Comments
 (0)