LineStyle, SymbolStyle: use scale on repeat values

This commit is contained in:
Emux 2019-09-28 19:38:22 +03:00
parent db9f83120a
commit 2cb0a80c47
No known key found for this signature in database
GPG Key ID: 64ED9980896038C3
2 changed files with 11 additions and 9 deletions

View File

@ -19,6 +19,7 @@
*/ */
package org.oscim.theme.styles; package org.oscim.theme.styles;
import org.oscim.backend.CanvasAdapter;
import org.oscim.backend.canvas.Color; import org.oscim.backend.canvas.Color;
import org.oscim.backend.canvas.Paint.Cap; import org.oscim.backend.canvas.Paint.Cap;
import org.oscim.renderer.bucket.TextureItem; import org.oscim.renderer.bucket.TextureItem;
@ -58,15 +59,15 @@ public final class LineStyle extends RenderStyle<LineStyle> {
public final float repeatGap; public final float repeatGap;
public LineStyle(int stroke, float width) { public LineStyle(int stroke, float width) {
this(0, "", stroke, width, Cap.BUTT, true, 1, 0, 0, 0, -1, 0, false, null, true, null, REPEAT_START_DEFAULT, REPEAT_GAP_DEFAULT); this(0, "", stroke, width, Cap.BUTT, true, 1, 0, 0, 0, -1, 0, false, null, true, null, REPEAT_START_DEFAULT * CanvasAdapter.getScale(), REPEAT_GAP_DEFAULT * CanvasAdapter.getScale());
} }
public LineStyle(int level, int stroke, float width) { public LineStyle(int level, int stroke, float width) {
this(level, "", stroke, width, Cap.BUTT, true, 1, 0, 0, 0, -1, 0, false, null, true, null, REPEAT_START_DEFAULT, REPEAT_GAP_DEFAULT); this(level, "", stroke, width, Cap.BUTT, true, 1, 0, 0, 0, -1, 0, false, null, true, null, REPEAT_START_DEFAULT * CanvasAdapter.getScale(), REPEAT_GAP_DEFAULT * CanvasAdapter.getScale());
} }
public LineStyle(int stroke, float width, Cap cap) { public LineStyle(int stroke, float width, Cap cap) {
this(0, "", stroke, width, cap, true, 1, 0, 0, 0, -1, 0, false, null, true, null, REPEAT_START_DEFAULT, REPEAT_GAP_DEFAULT); this(0, "", stroke, width, cap, true, 1, 0, 0, 0, -1, 0, false, null, true, null, REPEAT_START_DEFAULT * CanvasAdapter.getScale(), REPEAT_GAP_DEFAULT * CanvasAdapter.getScale());
} }
public LineStyle(int level, String style, int color, float width, public LineStyle(int level, String style, int color, float width,
@ -328,8 +329,8 @@ public final class LineStyle extends RenderStyle<LineStyle> {
symbolPercent = 100; symbolPercent = 100;
dashArray = null; dashArray = null;
repeatStart = REPEAT_START_DEFAULT; repeatStart = REPEAT_START_DEFAULT * CanvasAdapter.getScale();
repeatGap = REPEAT_GAP_DEFAULT; repeatGap = REPEAT_GAP_DEFAULT * CanvasAdapter.getScale();
return self(); return self();
} }

View File

@ -19,6 +19,7 @@
*/ */
package org.oscim.theme.styles; package org.oscim.theme.styles;
import org.oscim.backend.CanvasAdapter;
import org.oscim.backend.canvas.Bitmap; import org.oscim.backend.canvas.Bitmap;
import org.oscim.renderer.atlas.TextureRegion; import org.oscim.renderer.atlas.TextureRegion;
@ -67,8 +68,8 @@ public final class SymbolStyle extends RenderStyle<SymbolStyle> {
this.billboard = false; this.billboard = false;
this.repeat = false; this.repeat = false;
this.repeatStart = REPEAT_START_DEFAULT; this.repeatStart = REPEAT_START_DEFAULT * CanvasAdapter.getScale();
this.repeatGap = REPEAT_GAP_DEFAULT; this.repeatGap = REPEAT_GAP_DEFAULT * CanvasAdapter.getScale();
this.rotate = true; this.rotate = true;
} }
@ -221,8 +222,8 @@ public final class SymbolStyle extends RenderStyle<SymbolStyle> {
billboard = false; billboard = false;
repeat = false; repeat = false;
repeatStart = REPEAT_START_DEFAULT; repeatStart = REPEAT_START_DEFAULT * CanvasAdapter.getScale();
repeatGap = REPEAT_GAP_DEFAULT; repeatGap = REPEAT_GAP_DEFAULT * CanvasAdapter.getScale();
rotate = true; rotate = true;
return self(); return self();