- start to extract android graphics dependency
- make IRenderThemeCallback more consistent
This commit is contained in:
@@ -17,15 +17,14 @@ package org.oscim.renderer.layer;
|
||||
import java.nio.ShortBuffer;
|
||||
|
||||
import org.oscim.core.Tile;
|
||||
import org.oscim.graphics.Paint.Cap;
|
||||
import org.oscim.renderer.GLRenderer;
|
||||
import org.oscim.theme.renderinstruction.Line;
|
||||
import org.oscim.utils.FastMath;
|
||||
import org.oscim.view.MapView;
|
||||
|
||||
import android.graphics.Paint.Cap;
|
||||
|
||||
/**
|
||||
* @author Hannes Janetzek
|
||||
*/
|
||||
public final class LineLayer extends Layer {
|
||||
private static final float COORD_SCALE = GLRenderer.COORD_SCALE;
|
||||
|
||||
@@ -14,10 +14,10 @@
|
||||
*/
|
||||
package org.oscim.renderer.layer;
|
||||
|
||||
import org.oscim.graphics.Canvas;
|
||||
import org.oscim.graphics.Graphics;
|
||||
import org.oscim.renderer.TextureRenderer;
|
||||
|
||||
import android.graphics.Canvas;
|
||||
|
||||
public final class TextLayer extends TextureLayer {
|
||||
|
||||
//private static String TAG = TextureLayer.class.getName();
|
||||
@@ -39,7 +39,7 @@ public final class TextLayer extends TextureLayer {
|
||||
|
||||
public TextLayer() {
|
||||
type = Layer.SYMBOL;
|
||||
mCanvas = new Canvas();
|
||||
mCanvas = Graphics.res.getCanvas();
|
||||
fixed = true;
|
||||
}
|
||||
|
||||
@@ -139,13 +139,15 @@ public final class TextLayer extends TextureLayer {
|
||||
float hw = width / 2.0f;
|
||||
float hh = height / 2.0f;
|
||||
|
||||
float hh2 = 0;
|
||||
if (!it.text.caption) {
|
||||
// displace by baseline
|
||||
float desc = it.text.fontDescent / 2;
|
||||
hh2 = hh + desc;
|
||||
hh = hh - desc;
|
||||
}
|
||||
float hh2 = hh;
|
||||
//if (!it.text.caption) {
|
||||
// // displace by baseline
|
||||
// float desc = 0; //(hh - (height - it.text.fontDescent) / 2);
|
||||
//
|
||||
// //float desc = it.text.fontDescent / 2;
|
||||
// hh2 = hh + desc;
|
||||
// hh = hh - desc;
|
||||
//}
|
||||
|
||||
// texture coordinates
|
||||
short u1 = (short) (SCALE * x);
|
||||
@@ -240,7 +242,6 @@ public final class TextLayer extends TextureLayer {
|
||||
buf[pos++] = u2;
|
||||
buf[pos++] = v1;
|
||||
|
||||
|
||||
// six indices to draw the four vertices
|
||||
numIndices += TextureRenderer.INDICES_PER_SPRITE;
|
||||
verticesCnt += 4;
|
||||
|
||||
Reference in New Issue
Block a user