Fix rendering styles

This commit is contained in:
Victor Shcherb 2012-06-03 12:58:52 +02:00
parent 38ef6dbfc1
commit 7a378ae2dc
9 changed files with 159 additions and 97 deletions

View file

@ -48,7 +48,7 @@ public class BinaryInspector {
// test cases show info
// inspector(new String[]{"-vaddress", /*"-bbox=-121.785,37.35,-121.744,37.33", */"/home/victor/projects/OsmAnd/temp/.obf"});
// inspector(new String[]{"-vmap", /*"-bbox=-121.785,37.35,-121.744,37.33", */"/home/victor/projects/OsmAnd/*/Map.obf"});
// test case extract parts
// test case
}

View file

@ -23,15 +23,23 @@ public class RenderingRuleStorageProperties {
public static final String CAP_3 = "cap_3";
public static final String CAP_2 = "cap_2";
public static final String CAP = "cap";
public static final String CAP_0 = "cap_0";
public static final String CAP__1 = "cap__1";
public static final String PATH_EFFECT_3 = "pathEffect_3";
public static final String PATH_EFFECT_2 = "pathEffect_2";
public static final String PATH_EFFECT = "pathEffect";
public static final String PATH_EFFECT_0 = "pathEffect_0";
public static final String PATH_EFFECT__1 = "pathEffect__1";
public static final String STROKE_WIDTH_3 = "strokeWidth_3";
public static final String STROKE_WIDTH_2 = "strokeWidth_2";
public static final String STROKE_WIDTH = "strokeWidth";
public static final String STROKE_WIDTH_0 = "strokeWidth_0";
public static final String STROKE_WIDTH__1 = "strokeWidth__1";
public static final String COLOR_3 = "color_3";
public static final String COLOR = "color";
public static final String COLOR_2 = "color_2";
public static final String COLOR_0 = "color_0";
public static final String COLOR__1 = "color__1";
public static final String TEXT_BOLD = "textBold";
public static final String TEXT_ORDER = "textOrder";
public static final String TEXT_MIN_DISTANCE = "textMinDistance";
@ -70,15 +78,23 @@ public class RenderingRuleStorageProperties {
public RenderingRuleProperty R_CAP_3;
public RenderingRuleProperty R_CAP_2;
public RenderingRuleProperty R_CAP;
public RenderingRuleProperty R_CAP_0;
public RenderingRuleProperty R_CAP__1;
public RenderingRuleProperty R_PATH_EFFECT_3;
public RenderingRuleProperty R_PATH_EFFECT_2;
public RenderingRuleProperty R_PATH_EFFECT;
public RenderingRuleProperty R_PATH_EFFECT_0;
public RenderingRuleProperty R_PATH_EFFECT__1;
public RenderingRuleProperty R_STROKE_WIDTH_3;
public RenderingRuleProperty R_STROKE_WIDTH_2;
public RenderingRuleProperty R_STROKE_WIDTH;
public RenderingRuleProperty R_STROKE_WIDTH_0;
public RenderingRuleProperty R_STROKE_WIDTH__1;
public RenderingRuleProperty R_COLOR_3;
public RenderingRuleProperty R_COLOR;
public RenderingRuleProperty R_COLOR_2;
public RenderingRuleProperty R_COLOR_0;
public RenderingRuleProperty R_COLOR__1;
public RenderingRuleProperty R_TEXT_BOLD;
public RenderingRuleProperty R_TEXT_ORDER;
public RenderingRuleProperty R_TEXT_MIN_DISTANCE;
@ -169,16 +185,24 @@ public class RenderingRuleStorageProperties {
R_COLOR = registerRuleInternal(RenderingRuleProperty.createOutputColorProperty(COLOR));
R_COLOR_2 = registerRuleInternal(RenderingRuleProperty.createOutputColorProperty(COLOR_2));
R_COLOR_3 = registerRuleInternal(RenderingRuleProperty.createOutputColorProperty(COLOR_3));
R_COLOR_0 = registerRuleInternal(RenderingRuleProperty.createOutputColorProperty(COLOR_0));
R_COLOR__1 = registerRuleInternal(RenderingRuleProperty.createOutputColorProperty(COLOR__1));
R_STROKE_WIDTH = registerRuleInternal(RenderingRuleProperty.createOutputFloatProperty(STROKE_WIDTH));
R_STROKE_WIDTH_2 = registerRuleInternal(RenderingRuleProperty.createOutputFloatProperty(STROKE_WIDTH_2));
R_STROKE_WIDTH_3 = registerRuleInternal(RenderingRuleProperty.createOutputFloatProperty(STROKE_WIDTH_3));
R_STROKE_WIDTH_0 = registerRuleInternal(RenderingRuleProperty.createOutputFloatProperty(STROKE_WIDTH_0));
R_STROKE_WIDTH__1 = registerRuleInternal(RenderingRuleProperty.createOutputFloatProperty(STROKE_WIDTH__1));
R_PATH_EFFECT = registerRuleInternal(RenderingRuleProperty.createOutputStringProperty(PATH_EFFECT));
R_PATH_EFFECT_2 = registerRuleInternal(RenderingRuleProperty.createOutputStringProperty(PATH_EFFECT_2));
R_PATH_EFFECT_3 = registerRuleInternal(RenderingRuleProperty.createOutputStringProperty(PATH_EFFECT_3));
R_PATH_EFFECT_0 = registerRuleInternal(RenderingRuleProperty.createOutputStringProperty(PATH_EFFECT_0));
R_PATH_EFFECT__1 = registerRuleInternal(RenderingRuleProperty.createOutputStringProperty(PATH_EFFECT__1));
R_CAP = registerRuleInternal(RenderingRuleProperty.createOutputStringProperty(CAP));
R_CAP_2 = registerRuleInternal(RenderingRuleProperty.createOutputStringProperty(CAP_2));
R_CAP_3 = registerRuleInternal(RenderingRuleProperty.createOutputStringProperty(CAP_3));
R_CAP_0 = registerRuleInternal(RenderingRuleProperty.createOutputStringProperty(CAP_0));
R_CAP__1 = registerRuleInternal(RenderingRuleProperty.createOutputStringProperty(CAP__1));
R_SHADER = registerRuleInternal(RenderingRuleProperty.createOutputStringProperty(SHADER));
R_SHADOW_COLOR = registerRuleInternal(RenderingRuleProperty.createOutputColorProperty(SHADOW_COLOR));

View file

@ -3,6 +3,8 @@
<!-- Simple rule definition :
- "filter" is analogue of If(...) Else. So if one "filter" passes other neighbors will not be checked.
- "group" is tag to combine many filters and define common inner filter for them as "groupFilter"
- "group" can be only Top Level Elemenet!
- "groupFilter" attach If statement to parent "filter" or "group" element
- inner "filter" is kind of inner If(..) { If(...) Else ... } Else...
- ! All top level filters should have "tag" and "value" attributes to proper indexing them
-->
@ -1027,14 +1029,14 @@
</group>
<group>
<filter hmRendered="true" tag="highway" value="motorway" color="#809bff" color_2="#809bff"/>
<filter tag="highway" value="motorway" color="#a58dff" color_2="#a58dff"/>
<filter hmRendered="true" tag="highway" value="motorway_link" color="#809bff" color_2="#809bff"/>
<filter tag="highway" value="motorway_link" color="#a58dff" color_2="#a58dff"/>
<filter hmRendered="true" tag="highway" value="trunk" color="#df1346" color_2="#df1346"/>
<filter tag="highway" value="trunk" color="#ffaf80" color_2="#ffaf80"/>
<filter hmRendered="true" tag="highway" value="trunk_link" color="#df1346" color_2="#df1346"/>
<filter tag="highway" value="trunk_link" color="#ffaf80" color_2="#ffaf80"/>
<filter hmRendered="true" tag="highway" value="motorway" color="#809bff" color_2="#809bff"/>
<filter tag="highway" value="motorway" color="#a58dff" color_2="#a58dff"/>
<filter hmRendered="true" tag="highway" value="motorway_link" color="#809bff" color_2="#809bff"/>
<filter tag="highway" value="motorway_link" color="#a58dff" color_2="#a58dff"/>
<filter hmRendered="true" tag="highway" value="trunk" color="#df1346" color_2="#df1346"/>
<filter tag="highway" value="trunk" color="#ffaf80" color_2="#ffaf80"/>
<filter hmRendered="true" tag="highway" value="trunk_link" color="#df1346" color_2="#df1346"/>
<filter tag="highway" value="trunk_link" color="#ffaf80" color_2="#ffaf80"/>
<filter tag="highway" value="primary" color="#eb989a" color_2="#eb989a"/>
<filter tag="highway" value="primary_link" color="#eb989a" color_2="#eb989a"/>
<filter tag="highway" value="secondary" color="#fdd6a4" color_2="#fdd6a4"/>
@ -1088,30 +1090,10 @@
</group>
<group>
<filter tag="highway" value="road"/>
<filter tag="highway" value="unclassified"/>
<filter tag="highway" value="road" />
<filter tag="highway" value="unclassified" />
<filter tag="highway" value="residential"/>
<groupFilter color="#ffffff" color_2="#ffffff" shadowRadius="1" cap="ROUND">
<!-- Bridges -->
<filter layer="1" color="#000000" shadowRadius="0" cap="BUTT" cap_2="SQUARE">
<filter hmRendered="true" minzoom="14" maxzoom="14" strokeWidth="8" strokeWidth_2="6"/>
<filter minzoom="14" maxzoom="14" strokeWidth="5" strokeWidth_2="3"/>
<filter minzoom="15" maxzoom="15" strokeWidth="10" strokeWidth_2="8"/>
<filter minzoom="16" maxzoom="16" strokeWidth="12" strokeWidth_2="10"/>
<filter minzoom="17" maxzoom="17" strokeWidth="15" strokeWidth_2="13"/>
<filter minzoom="18" strokeWidth="20" strokeWidth_2="18"/>
<groupFilter>
<filter nightMode="true" color="#ffffff" color_2="#9F9F9F"/>
<filter/>
<groupFilter>
<filter additional="access=no" />
<filter additional="access=private" />
<groupFilter>
<filter color_3="#F7D4D4" strokeWidth_3="5" pathEffect_3="10_2"/>
</groupFilter>
</groupFilter>
</groupFilter>
</filter>
<groupFilter color="#ffffff" shadowRadius="1" cap="ROUND">
<filter>
<filter hmRendered="true" minzoom="12" maxzoom="12" strokeWidth="3"/>
<filter hmRendered="true" minzoom="13" maxzoom="13" strokeWidth="4"/>
@ -1122,20 +1104,19 @@
<filter minzoom="16" maxzoom="16" strokeWidth="10"/>
<filter minzoom="17" maxzoom="17" strokeWidth="13"/>
<filter minzoom="18" strokeWidth="18"/>
<groupFilter>
<!-- <filter layer="-1" nightMode="true" color="#9F9F9F" color_2="#9F9F9F" pathEffect="4_4" cap="BUTT"/>
<filter layer="-1" pathEffect="4_4" cap="BUTT"/>
<filter nightMode="true" color="#9F9F9F" color_2="#9F9F9F" />
<filter/>
<groupFilter> -->
<filter additional="access=no" color_3="#F7D4D4" strokeWidth_3="5" pathEffect_3="10_2"/>
<filter additional="access=private" color_3="#F7D4D4" strokeWidth_3="5" pathEffect_3="10_2"/>
<groupFilter>
<filter color_3="#F7D4D4" strokeWidth_3="5" pathEffect_3="10_2"/>
</groupFilter>
<!-- </groupFilter> -->
</groupFilter>
</filter>
<groupFilter nightMode="true" color="#9F9F9F" color_0="#ffffff" />
<groupFilter layer="-1" pathEffect="4_4" cap="BUTT"/>
<!-- Bridges -->
<groupFilter layer="1" color_0="#000000" minzoom="14" shadowRadius="0" cap_0="BUTT" cap="SQUARE">
<filter minzoom="14" maxzoom="14" strokeWidth_0="5"/>
<filter minzoom="15" maxzoom="15" strokeWidth_0="10"/>
<filter minzoom="16" maxzoom="16" strokeWidth_0="12"/>
<filter minzoom="17" maxzoom="17" strokeWidth_0="15"/>
<filter minzoom="18" strokeWidth="20" strokeWidth_2="18"/>
</groupFilter>
<groupFilter minzoom="15" additional="access=no" color_3="#F7D4D4" strokeWidth_3="5" pathEffect_3="10_3"/>
<groupFilter minzoom="15" additional="access=private" color_3="#F7D4D4" strokeWidth_3="5" pathEffect_3="10_3"/>
</groupFilter>
</group>
@ -1151,11 +1132,7 @@
<filter minzoom="16" maxzoom="16" strokeWidth="7" strokeWidth_2="5"/>
<filter minzoom="17" maxzoom="17" strokeWidth="10" strokeWidth_2="8"/>
<filter minzoom="18" strokeWidth="14" strokeWidth_2="12"/>
<groupFilter>
<filter additional="access=no" nightMode="true" color="#ffffff" color_3="#F7D4D4" strokeWidth_3="3" pathEffect_3="10_2"/>
<filter nightMode="true" color="#ffffff"/>
<filter additional="access=no" color_3="#F7D4D4" strokeWidth_3="3" pathEffect_3="10_2"/>
</groupFilter>
<groupFilter nightMode="true" color="#ffffff"/>
</filter>
<filter>
<filter hmRendered="true" minzoom="13" maxzoom="13" strokeWidth="2"/>
@ -1164,27 +1141,26 @@
<filter minzoom="16" maxzoom="16" strokeWidth="5"/>
<filter minzoom="17" maxzoom="17" strokeWidth="8"/>
<filter minzoom="18" strokeWidth="11"/>
<groupFilter>
<filter layer="-1" pathEffect="4_4" cap="BUTT"/>
<filter additional="access=no" color_3="#F7D4D4" strokeWidth_3="3" pathEffect_3="10_2"/>
</groupFilter>
<groupFilter layer="-1" pathEffect="4_4" cap="BUTT"/>
</filter>
<groupFilter minzoom="15" additional="access=no" color_3="#F7D4D4" strokeWidth_3="3" pathEffect_3="10_3"/>
<groupFilter minzoom="15" additional="access=private" color_3="#F7D4D4" strokeWidth_3="3" pathEffect_3="10_3"/>
</groupFilter>
</group>
<group>
<filter tag="highway" value="track" color="#996600" pathEffect="5_5" color_3="#996600" pathEffect_3="5_5">
<filter appMode="pedestrian" hmRendered="true" minzoom="14" strokeWidth="2" strokeWidth_3="2"/>
<filter appMode="pedestrian" minzoom="15" strokeWidth="2" strokeWidth_3="2" />
<filter hmRendered="true" minzoom="12" maxzoom="12" strokeWidth="0.5" strokeWidth_3="0.5"/>
<filter hmRendered="true" minzoom="13" strokeWidth="1" strokeWidth_3="1"/>
<filter minzoom="14" strokeWidth="1" strokeWidth_3="1"/>
<filter tag="highway" value="track" color="#996600" pathEffect="5_5">
<filter appMode="pedestrian" hmRendered="true" minzoom="14" strokeWidth="2" />
<filter appMode="pedestrian" minzoom="15" strokeWidth="2" />
<filter hmRendered="true" minzoom="12" maxzoom="12" strokeWidth="0.5" />
<filter hmRendered="true" minzoom="13" strokeWidth="1" />
<filter minzoom="14" strokeWidth="1"/>
<groupFilter>
<filter additional="tracktype=grade1" pathEffect="" pathEffect_3=""/>
<filter additional="tracktype=grade2" pathEffect="10_3" pathEffect_3="10_3"/>
<filter additional="tracktype=grade3" pathEffect="5_2" pathEffect_3="5_2"/>
<filter additional="tracktype=grade4" pathEffect="5_3_2_3" pathEffect_3="5_3_2_3"/>
<filter additional="tracktype=grade5" pathEffect="3_3" pathEffect_3="3_3"/>
<filter additional="tracktype=grade1" pathEffect=""/>
<filter additional="tracktype=grade2" pathEffect="10_3" />
<filter additional="tracktype=grade3" pathEffect="5_2"/>
<filter additional="tracktype=grade4" pathEffect="5_3_2_3"/>
<filter additional="tracktype=grade5" pathEffect="3_3" />
</groupFilter>
</filter>
@ -1198,16 +1174,14 @@
<filter minzoom="14" strokeWidth="1" strokeWidth_3="1"/>
</filter>
<group>
<filter tag="highway" value="path" color="#000000" pathEffect="6_3" color_3="#000000" pathEffect_3="6_3">
<filter appMode="pedestrian" hmRendered="true" minzoom="14" strokeWidth="2" pathEffect="10_3" strokeWidth_3="2" pathEffect_3="10_3"/>
<filter appMode="pedestrian" minzoom="15" strokeWidth="2" pathEffect="10_3" strokeWidth_3="2" pathEffect_3="10_3"/>
<filter hmRendered="true" minzoom="12" maxzoom="12" strokeWidth="0.5" strokeWidth_3="0.5"/>
<filter hmRendered="true" minzoom="13" strokeWidth="1" strokeWidth_3="1"/>
<filter minzoom="14" strokeWidth="1" strokeWidth_3="1"/>
</filter>
<groupFilter nightMode="true" color="#787878" color_3="#787878"/>
</group>
<filter tag="highway" value="path" color="#000000" pathEffect="6_3" color_3="#000000" pathEffect_3="6_3">
<filter appMode="pedestrian" hmRendered="true" minzoom="14" strokeWidth="2" pathEffect="10_3" strokeWidth_3="2" pathEffect_3="10_3"/>
<filter appMode="pedestrian" minzoom="15" strokeWidth="2" pathEffect="10_3" strokeWidth_3="2" pathEffect_3="10_3"/>
<filter hmRendered="true" minzoom="12" maxzoom="12" strokeWidth="0.5" strokeWidth_3="0.5"/>
<filter hmRendered="true" minzoom="13" strokeWidth="1" strokeWidth_3="1"/>
<filter minzoom="14" strokeWidth="1" strokeWidth_3="1"/>
<groupFilter nightMode="true" color="#787878" color_3="#787878"/>
</filter>
<filter tag="highway" value="cycleway" color="#0000ff" pathEffect="2_2" color_3="#0000ff" pathEffect_3="2_2">
<filter appMode="bicycle" minzoom="14" strokeWidth="2" pathEffect="10_3" strokeWidth_3="2" pathEffect_3="10_3"/>
@ -1242,8 +1216,13 @@
<!-- Bridges -->
<groupFilter layer="1">
<filter nightMode="false" minzoom="14" color="#000000" strokeWidth="6.5" pathEffect="" color_2="#ffffff" strokeWidth_2="5"/>
<filter nightMode="true" minzoom="14" color="#ffffff" strokeWidth="6.5" pathEffect="" color_2="#000000" strokeWidth_2="5"/>
<filter minzoom="14" color="#000000" strokeWidth="6.5" pathEffect="" color_2="#ffffff" strokeWidth_2="5"/>
</groupFilter>
<!-- Tunnels -->
<groupFilter layer="-1">
<filter nightMode="true" minzoom="14" color="#ffffff" strokeWidth="6.5" pathEffect="3_3" color_2="#000000" strokeWidth_2="5"/>
<filter minzoom="14" color="#000000" strokeWidth="6.5" pathEffect="3_3" color_2="#ffffff" strokeWidth_2="5"/>
</groupFilter>
</group>

View file

@ -456,6 +456,7 @@ public class MapActivityActions implements DialogProvider {
location.setLatitude(lat);
location.setLongitude(lon);
routingHelper.setAppMode(mode);
settings.PREV_APPLICATION_MODE.set(settings.APPLICATION_MODE.get());
settings.FOLLOW_THE_ROUTE.set(false);
settings.FOLLOW_THE_GPX_ROUTE.set(null);
routingHelper.setFollowingMode(false);

View file

@ -486,10 +486,7 @@ public class OsmandRenderer {
RenderingRuleProperty rCap;
RenderingRuleProperty rPathEff;
p.setShader(null);
p.setColorFilter(null);
p.clearShadowLayer();
if(ind == 0){
if (ind == 0) {
rColor = req.ALL.R_COLOR;
rStrokeW = req.ALL.R_STROKE_WIDTH;
rCap = req.ALL.R_CAP;
@ -499,6 +496,16 @@ public class OsmandRenderer {
rStrokeW = req.ALL.R_STROKE_WIDTH_2;
rCap = req.ALL.R_CAP_2;
rPathEff = req.ALL.R_PATH_EFFECT_2;
} else if(ind == -1){
rColor = req.ALL.R_COLOR_0;
rStrokeW = req.ALL.R_STROKE_WIDTH_0;
rCap = req.ALL.R_CAP_0;
rPathEff = req.ALL.R_PATH_EFFECT_0;
} else if(ind == -2){
rColor = req.ALL.R_COLOR__1;
rStrokeW = req.ALL.R_STROKE_WIDTH__1;
rCap = req.ALL.R_CAP__1;
rPathEff = req.ALL.R_PATH_EFFECT__1;
} else {
rColor = req.ALL.R_COLOR_3;
rStrokeW = req.ALL.R_STROKE_WIDTH_3;
@ -509,12 +516,18 @@ public class OsmandRenderer {
if(!req.isSpecified(rColor) && !req.isSpecified(req.ALL.R_SHADER)){
return false;
}
p.setShader(null);
p.setColorFilter(null);
p.clearShadowLayer();
p.setStyle(Style.FILL_AND_STROKE);
p.setStrokeWidth(0);
} else {
if(!req.isSpecified(rStrokeW)){
return false;
}
p.setShader(null);
p.setColorFilter(null);
p.clearShadowLayer();
p.setStyle(Style.STROKE);
p.setStrokeWidth(req.getFloatPropertyValue(rStrokeW));
String cap = req.getStringPropertyValue(rCap);
@ -675,12 +688,18 @@ public class OsmandRenderer {
}
drawPolylineShadow(canvas, rc, path, shadowColor, shadowRadius);
} else {
if (updatePaint(render, paint, -2, false, rc)) {
canvas.drawPath(path, paint);
}
if (updatePaint(render, paint, -1, false, rc)) {
canvas.drawPath(path, paint);
}
canvas.drawPath(path, paint);
if (updatePaint(render, paint, 1, false, rc)) {
canvas.drawPath(path, paint);
if (updatePaint(render, paint, 2, false, rc)) {
canvas.drawPath(path, paint);
}
}
if (updatePaint(render, paint, 2, false, rc)) {
canvas.drawPath(path, paint);
}
}

View file

@ -36,8 +36,8 @@ public:
bool containsAdditional(std::string key, std::string val) {
std::vector<tag_value>::iterator it = additionalTypes.begin();
while (it != additionalTypes.end()) {
if (it->first == key) {
return it->second == val;
if (it->first == key && it->second == val) {
return true;
}
it++;
}
@ -63,7 +63,7 @@ public:
if(it->second[0] == '-'){
return -1;
} else {
return 0;
return 1;
}
} else {
return 0;

View file

@ -590,15 +590,17 @@ bool RenderingRuleSearchRequest::visitRule(RenderingRule* rule, bool loadOutput)
} else if (rp == PROPS->R_MAXZOOM) {
match = rule->intProperties[i] >= values[rp->id];
} else if (rp == PROPS->R_ADDITIONAL) {
if(obj == NULL){
return true;
if (obj == NULL) {
match = true;
} else {
std::string val = storage->getDictionaryValue(rule->intProperties[i]);
int i = val.find('=');
if (i >= 0) {
match = obj->containsAdditional(val.substr(0, i), val.substr(i + 1));
} else {
match = false;
}
}
std::string val = storage->getDictionaryValue(rule->intProperties[i]);
int i = val.find('=');
if(i >= 0) {
return obj->containsAdditional(val.substr(0, i), val.substr(i+1));
}
return false;
} else {
match = rule->intProperties[i] == values[rp->id];
}

View file

@ -186,15 +186,23 @@ public:
RenderingRuleProperty* R_CAP_3;
RenderingRuleProperty* R_CAP_2;
RenderingRuleProperty* R_CAP;
RenderingRuleProperty* R_CAP_0;
RenderingRuleProperty* R_CAP__1;
RenderingRuleProperty* R_PATH_EFFECT_3;
RenderingRuleProperty* R_PATH_EFFECT_2;
RenderingRuleProperty* R_PATH_EFFECT;
RenderingRuleProperty* R_PATH_EFFECT_0;
RenderingRuleProperty* R_PATH_EFFECT__1;
RenderingRuleProperty* R_STROKE_WIDTH_3;
RenderingRuleProperty* R_STROKE_WIDTH_2;
RenderingRuleProperty* R_STROKE_WIDTH;
RenderingRuleProperty* R_STROKE_WIDTH_0;
RenderingRuleProperty* R_STROKE_WIDTH__1;
RenderingRuleProperty* R_COLOR_3;
RenderingRuleProperty* R_COLOR;
RenderingRuleProperty* R_COLOR_2;
RenderingRuleProperty* R_COLOR_0;
RenderingRuleProperty* R_COLOR__1;
RenderingRuleProperty* R_TEXT_BOLD;
RenderingRuleProperty* R_TEXT_ORDER;
RenderingRuleProperty* R_TEXT_MIN_DISTANCE;
@ -330,16 +338,24 @@ public:
R_COLOR = registerRuleInternal(RenderingRuleProperty::createOutputColorProperty("color"));
R_COLOR_2 = registerRuleInternal(RenderingRuleProperty::createOutputColorProperty("color_2"));
R_COLOR_3 = registerRuleInternal(RenderingRuleProperty::createOutputColorProperty("color_3"));
R_COLOR_0 = registerRuleInternal(RenderingRuleProperty::createOutputColorProperty("color_0"));
R_COLOR__1 = registerRuleInternal(RenderingRuleProperty::createOutputColorProperty("color__1"));
R_STROKE_WIDTH = registerRuleInternal(RenderingRuleProperty::createOutputFloatProperty("strokeWidth"));
R_STROKE_WIDTH_2 = registerRuleInternal(RenderingRuleProperty::createOutputFloatProperty("strokeWidth_2"));
R_STROKE_WIDTH_3 = registerRuleInternal(RenderingRuleProperty::createOutputFloatProperty("strokeWidth_3"));
R_STROKE_WIDTH_0 = registerRuleInternal(RenderingRuleProperty::createOutputFloatProperty("strokeWidth_0"));
R_STROKE_WIDTH__1 = registerRuleInternal(RenderingRuleProperty::createOutputFloatProperty("strokeWidth__1"));
R_PATH_EFFECT = registerRuleInternal(RenderingRuleProperty::createOutputStringProperty("pathEffect"));
R_PATH_EFFECT_2 = registerRuleInternal(RenderingRuleProperty::createOutputStringProperty("pathEffect_2"));
R_PATH_EFFECT_3 = registerRuleInternal(RenderingRuleProperty::createOutputStringProperty("pathEffect_3"));
R_PATH_EFFECT_0 = registerRuleInternal(RenderingRuleProperty::createOutputStringProperty("pathEffect_0"));
R_PATH_EFFECT__1 = registerRuleInternal(RenderingRuleProperty::createOutputStringProperty("pathEffect__1"));
R_CAP = registerRuleInternal(RenderingRuleProperty::createOutputStringProperty("cap"));
R_CAP_2 = registerRuleInternal(RenderingRuleProperty::createOutputStringProperty("cap_2"));
R_CAP_3 = registerRuleInternal(RenderingRuleProperty::createOutputStringProperty("cap_3"));
R_CAP_0 = registerRuleInternal(RenderingRuleProperty::createOutputStringProperty("cap_0"));
R_CAP__1 = registerRuleInternal(RenderingRuleProperty::createOutputStringProperty("cap__1"));
R_SHADER = registerRuleInternal(RenderingRuleProperty::createOutputStringProperty("shader"));
R_SHADOW_COLOR = registerRuleInternal(RenderingRuleProperty::createOutputColorProperty("shadowColor"));

View file

@ -106,6 +106,20 @@ int updatePaint(RenderingRuleSearchRequest* req, SkPaint* paint, int ind, int ar
rCap = req->props()->R_CAP_2;
rPathEff = req->props()->R_PATH_EFFECT_2;
}
else if (ind == -1)
{
rColor = req->props()->R_COLOR_0;
rStrokeW = req->props()->R_STROKE_WIDTH_0;
rCap = req->props()->R_CAP_0;
rPathEff = req->props()->R_PATH_EFFECT_0;
}
else if (ind == -2)
{
rColor = req->props()->R_COLOR__1;
rStrokeW = req->props()->R_STROKE_WIDTH__1;
rCap = req->props()->R_CAP__1;
rPathEff = req->props()->R_PATH_EFFECT__1;
}
else
{
rColor = req->props()->R_COLOR_3;
@ -316,18 +330,25 @@ void drawPolyline(MapDataObject* mObj, RenderingRuleSearchRequest* req, SkCanvas
path.lineTo(rc->calcX, rc->calcY);
}
}
if (i > 0) {
if (drawOnlyShadow) {
int shadowColor = req->getIntPropertyValue(req->props()->R_SHADOW_COLOR);
int shadowRadius = req->getIntPropertyValue(req->props()->R_SHADOW_RADIUS);
drawPolylineShadow(cv, paint, rc, &path, shadowColor, shadowRadius);
} else {
if (updatePaint(req, paint, -2, 0, rc)) {
PROFILE_NATIVE_OPERATION(rc, cv->drawPath(path, *paint));
}
if (updatePaint(req, paint, -1, 0, rc)) {
PROFILE_NATIVE_OPERATION(rc, cv->drawPath(path, *paint));
}
PROFILE_NATIVE_OPERATION(rc, cv->drawPath(path, *paint));
if (updatePaint(req, paint, 1, 0, rc)) {
PROFILE_NATIVE_OPERATION(rc, cv->drawPath(path, *paint));
if (updatePaint(req, paint, 2, 0, rc)) {
PROFILE_NATIVE_OPERATION(rc, cv->drawPath(path, *paint));
}
}
if (updatePaint(req, paint, 2, 0, rc)) {
PROFILE_NATIVE_OPERATION(rc, cv->drawPath(path, *paint));
}
if (oneway && !drawOnlyShadow) {
drawOneWayPaints(rc, cv, &path);