PathLayer(s) scaled width, fix #594
This commit is contained in:
@@ -65,6 +65,8 @@ public class VectorLayer extends AbstractVectorLayer<Drawable> implements Gestur
|
||||
|
||||
public static final Logger log = LoggerFactory.getLogger(VectorLayer.class);
|
||||
|
||||
private static final int STROKE_MIN_ZOOM = 12;
|
||||
|
||||
//private final SpatialIndex<Drawable> mDrawables = new RTree<Drawable>();
|
||||
protected final SpatialIndex<Drawable> mDrawables = new QuadTree<Drawable>(1 << 30, 18);
|
||||
|
||||
@@ -263,21 +265,25 @@ public class VectorLayer extends AbstractVectorLayer<Drawable> implements Gestur
|
||||
if (ll.line == null) {
|
||||
ll.line = LineStyle.builder()
|
||||
.reset()
|
||||
.blur(style.blur)
|
||||
.cap(style.cap)
|
||||
.color(style.strokeColor)
|
||||
.fixed(style.fixed)
|
||||
.blur(style.blur)
|
||||
.heightOffset(style.heightOffset)
|
||||
.level(0)
|
||||
.randomOffset(style.randomOffset)
|
||||
.stipple(style.stipple)
|
||||
.stippleColor(style.stippleColor)
|
||||
.stippleWidth(style.stippleWidth)
|
||||
.strokeIncrease(style.strokeIncrease)
|
||||
.strokeWidth(style.strokeWidth)
|
||||
.texture(style.texture)
|
||||
.build();
|
||||
}
|
||||
|
||||
if (!style.fixed && style.strokeIncrease > 1)
|
||||
ll.scale = (float) Math.pow(style.strokeIncrease, Math.max(t.position.getZoom() - STROKE_MIN_ZOOM, 0));
|
||||
|
||||
if (style.generalization != Style.GENERALIZATION_NONE) {
|
||||
line = DouglasPeuckerSimplifier.simplify(line, mMinX * style.generalization);
|
||||
}
|
||||
|
||||
@@ -46,6 +46,7 @@ public class Style {
|
||||
|
||||
public final Paint.Cap cap;
|
||||
public final boolean fixed;
|
||||
public final double strokeIncrease;
|
||||
public final float blur;
|
||||
public final int stipple;
|
||||
public final int stippleColor;
|
||||
@@ -69,6 +70,7 @@ public class Style {
|
||||
|
||||
cap = builder.cap;
|
||||
fixed = builder.fixed;
|
||||
strokeIncrease = builder.strokeIncrease;
|
||||
blur = builder.blur;
|
||||
stipple = builder.stipple;
|
||||
stippleColor = builder.stippleColor;
|
||||
@@ -103,6 +105,7 @@ public class Style {
|
||||
|
||||
public Paint.Cap cap = Paint.Cap.ROUND;
|
||||
public boolean fixed = false;
|
||||
public double strokeIncrease = 1;
|
||||
public float blur = 0;
|
||||
public int stipple = 0;
|
||||
public int stippleColor = Color.GRAY;
|
||||
@@ -210,6 +213,11 @@ public class Style {
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder strokeIncrease(double strokeIncrease) {
|
||||
this.strokeIncrease = strokeIncrease;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder blur(float blur) {
|
||||
this.blur = blur;
|
||||
return this;
|
||||
|
||||
Reference in New Issue
Block a user