Fix java/C++ rendering rules property - should match types

This commit is contained in:
Victor Shcherb 2020-10-18 11:55:23 +02:00
parent 0bc9008b9f
commit 684f2b95d7

View file

@ -41,7 +41,7 @@ public class RenderingRule {
public void init(Map<String, String> attributes) {
ArrayList<RenderingRuleProperty> props = new ArrayList<RenderingRuleProperty>(attributes.size());
intProperties = new int[attributes.size()];
floatProperties = null;
floatProperties = new float[attributes.size()];
attributesRef = null;
int i = 0;
Iterator<Entry<String, String>> it = attributes.entrySet().iterator();
@ -60,11 +60,11 @@ public class RenderingRule {
intProperties[i] = storage.getDictionaryValue(vl);
} else {
float floatVal = property.parseFloatValue(vl);
if (floatProperties == null && floatVal != 0) {
// lazy creates
floatProperties = new float[attributes.size()];
floatProperties[i] = property.parseFloatValue(vl);
}
// if (floatProperties == null && floatVal != 0) {
// // lazy creates
// floatProperties = new float[attributes.size()];
floatProperties[i] = floatVal;
// }
intProperties[i] = property.parseIntValue(vl);
}
i++;
@ -94,7 +94,7 @@ public class RenderingRule {
public float getFloatPropertyValue(String property) {
int i = getPropertyIndex(property);
if(i >= 0 && floatProperties != null){
if (i >= 0) {
return floatProperties[i];
}
return 0;