Line texture: randomize offset rendering, #105

This commit is contained in:
Emux
2016-08-05 13:26:43 +03:00
parent b32b5ceb0b
commit 14108fcfe7
7 changed files with 41 additions and 12 deletions

View File

@@ -264,6 +264,7 @@ public class VectorLayer extends AbstractVectorLayer<Drawable> {
.color(style.strokeColor)
.fixed(style.fixed)
.level(0)
.randomOffset(style.randomOffset)
.stipple(style.stipple)
.stippleColor(style.stippleColor)
.stippleWidth(style.stippleWidth)

View File

@@ -50,6 +50,8 @@ public class Style {
public final float stippleWidth;
public final TextureItem texture;
public final boolean randomOffset;
private Style(Builder builder) {
strokeWidth = builder.strokeWidth;
strokeColor = builder.strokeColor;
@@ -68,6 +70,8 @@ public class Style {
stippleColor = builder.stippleColor;
stippleWidth = builder.stippleWidth;
texture = builder.texture;
randomOffset = builder.randomOffset;
}
/**
@@ -99,6 +103,8 @@ public class Style {
public float stippleWidth = 1;
public TextureItem texture = null;
public boolean randomOffset = true;
protected Builder() {
}
@@ -221,6 +227,11 @@ public class Style {
this.texture = texture;
return this;
}
public Builder randomOffset(boolean randomOffset) {
this.randomOffset = randomOffset;
return this;
}
}
static final Style DEFAULT_STYLE = new Builder()