use RenderStyle.current() to get the active style
This commit is contained in:
parent
1b09774413
commit
b0217767b8
@ -749,7 +749,7 @@ public final class LineLayer extends RenderElement {
|
|||||||
RenderElement l = curLayer;
|
RenderElement l = curLayer;
|
||||||
for (; l != null && l.type == RenderElement.LINE; l = l.next) {
|
for (; l != null && l.type == RenderElement.LINE; l = l.next) {
|
||||||
LineLayer ll = (LineLayer) l;
|
LineLayer ll = (LineLayer) l;
|
||||||
LineStyle line = (LineStyle) ll.line.getCurrent();
|
LineStyle line = ll.line.current();
|
||||||
|
|
||||||
if (ll.heightOffset != heightOffset) {
|
if (ll.heightOffset != heightOffset) {
|
||||||
heightOffset = ll.heightOffset;
|
heightOffset = ll.heightOffset;
|
||||||
@ -820,7 +820,7 @@ public final class LineLayer extends RenderElement {
|
|||||||
/* draw LineLayers references by this outline */
|
/* draw LineLayers references by this outline */
|
||||||
|
|
||||||
for (LineLayer ref = ll.outlines; ref != null; ref = ref.outlines) {
|
for (LineLayer ref = ll.outlines; ref != null; ref = ref.outlines) {
|
||||||
LineStyle core = (LineStyle) ref.line.getCurrent();
|
LineStyle core = ref.line.current();
|
||||||
|
|
||||||
// core width
|
// core width
|
||||||
if (core.fixed) {
|
if (core.fixed) {
|
||||||
|
|||||||
@ -362,7 +362,7 @@ public final class LineTexLayer extends RenderElement {
|
|||||||
RenderElement l = curLayer;
|
RenderElement l = curLayer;
|
||||||
for (; l != null && l.type == TEXLINE; l = l.next) {
|
for (; l != null && l.type == TEXLINE; l = l.next) {
|
||||||
LineTexLayer ll = (LineTexLayer) l;
|
LineTexLayer ll = (LineTexLayer) l;
|
||||||
LineStyle line = ll.line;
|
LineStyle line = ll.line.current();
|
||||||
|
|
||||||
GLUtils.setColor(hTexColor, line.stippleColor, 1);
|
GLUtils.setColor(hTexColor, line.stippleColor, 1);
|
||||||
GLUtils.setColor(hBgColor, line.color, 1);
|
GLUtils.setColor(hBgColor, line.color, 1);
|
||||||
|
|||||||
@ -91,6 +91,7 @@ public class AreaStyle extends RenderStyle {
|
|||||||
outline.update();
|
outline.update();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public AreaStyle current() {
|
public AreaStyle current() {
|
||||||
return (AreaStyle) (mCurrent == null ? this : mCurrent);
|
return (AreaStyle) (mCurrent == null ? this : mCurrent);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -51,4 +51,9 @@ public final class CircleStyle extends RenderStyle {
|
|||||||
public void renderNode(Callback renderCallback) {
|
public void renderNode(Callback renderCallback) {
|
||||||
renderCallback.renderCircle(this, this.level);
|
renderCallback.renderCircle(this, this.level);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public CircleStyle current() {
|
||||||
|
return (CircleStyle) (mCurrent == null ? this : mCurrent);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -61,6 +61,11 @@ public class ExtrusionStyle extends RenderStyle {
|
|||||||
renderCallback.renderExtrusion(this, this.level);
|
renderCallback.renderExtrusion(this, this.level);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ExtrusionStyle current() {
|
||||||
|
return (ExtrusionStyle) (mCurrent == null ? this : mCurrent);
|
||||||
|
}
|
||||||
|
|
||||||
private final int level;
|
private final int level;
|
||||||
public final float[] colors;
|
public final float[] colors;
|
||||||
public final int defaultHeight;
|
public final int defaultHeight;
|
||||||
|
|||||||
@ -93,6 +93,11 @@ public final class LineStyle extends RenderStyle {
|
|||||||
renderCallback.renderWay(this, level);
|
renderCallback.renderWay(this, level);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public LineStyle current() {
|
||||||
|
return (LineStyle) (mCurrent == null ? this : mCurrent);
|
||||||
|
}
|
||||||
|
|
||||||
public final static class LineBuilder {
|
public final static class LineBuilder {
|
||||||
public int level;
|
public int level;
|
||||||
|
|
||||||
|
|||||||
@ -74,7 +74,5 @@ public abstract class RenderStyle {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public RenderStyle getCurrent() {
|
public abstract RenderStyle current();
|
||||||
return mCurrent == null ? this : mCurrent;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -44,4 +44,9 @@ public final class SymbolStyle extends RenderStyle {
|
|||||||
public void renderWay(Callback cb) {
|
public void renderWay(Callback cb) {
|
||||||
cb.renderSymbol(this);
|
cb.renderSymbol(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public SymbolStyle current() {
|
||||||
|
return (SymbolStyle) (mCurrent == null ? this : mCurrent);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -191,6 +191,11 @@ public final class TextStyle extends RenderStyle {
|
|||||||
cb.renderText(this);
|
cb.renderText(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TextStyle current() {
|
||||||
|
return (TextStyle) (mCurrent == null ? this : mCurrent);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void scaleTextSize(float scaleFactor) {
|
public void scaleTextSize(float scaleFactor) {
|
||||||
paint.setTextSize(fontSize * scaleFactor);
|
paint.setTextSize(fontSize * scaleFactor);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user