Render themes: stroke dash array supports odd entries number #131

This commit is contained in:
Emux 2017-09-26 21:35:05 +03:00
parent c8817f80c8
commit d80e4fdabc
2 changed files with 14 additions and 0 deletions

View File

@ -583,6 +583,13 @@ public class XmlMapsforgeThemeBuilder extends DefaultHandler {
if (b.dashArray != null) {
// Stroke dash array
if (b.dashArray.length % 2 != 0) {
// Odd number of entries is duplicated
float[] newDashArray = new float[b.dashArray.length * 2];
System.arraycopy(b.dashArray, 0, newDashArray, 0, b.dashArray.length);
System.arraycopy(b.dashArray, 0, newDashArray, b.dashArray.length, b.dashArray.length);
b.dashArray = newDashArray;
}
int width = 0;
int height = (int) (b.strokeWidth);
if (height < 1)

View File

@ -578,6 +578,13 @@ public class XmlThemeBuilder extends DefaultHandler {
if (b.dashArray != null) {
// Stroke dash array
if (b.dashArray.length % 2 != 0) {
// Odd number of entries is duplicated
float[] newDashArray = new float[b.dashArray.length * 2];
System.arraycopy(b.dashArray, 0, newDashArray, 0, b.dashArray.length);
System.arraycopy(b.dashArray, 0, newDashArray, b.dashArray.length, b.dashArray.length);
b.dashArray = newDashArray;
}
int width = 0;
int height = (int) (b.strokeWidth);
if (height < 1)