Merge remote-tracking branch 'origin/master'

This commit is contained in:
Weblate 2016-09-08 00:33:15 +02:00
commit 8a7368e3e2
3 changed files with 51 additions and 38 deletions

View file

@ -1,38 +0,0 @@
package net.osmand;
/**
* This class can be replaced with more effective on ARM devices
*/
public class FloatMath {
public static float PI = (float) Math.PI;
public static float cos(float a) {
return (float) Math.cos(a);
}
public static float sin(float a) {
return (float) Math.sin(a);
}
public static float abs(float a) {
return (float) Math.abs(a);
}
public static float atan2(float py, float px) {
return (float) Math.atan2(py, px);
}
public static float sqrt(float f) {
return (float) Math.sqrt(f);
}
public static float max(float a, float b) {
if(a > b) {
return a;
}
return b;
}
}

View file

@ -12,10 +12,14 @@ import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.Collections; import java.util.Collections;
import java.util.Comparator; import java.util.Comparator;
import java.util.LinkedHashMap;
import java.util.Map;
import net.osmand.binary.BinaryMapRouteReaderAdapter.RouteRegion; import net.osmand.binary.BinaryMapRouteReaderAdapter.RouteRegion;
import net.osmand.binary.BinaryMapRouteReaderAdapter.RouteSubregion; import net.osmand.binary.BinaryMapRouteReaderAdapter.RouteSubregion;
import net.osmand.binary.RouteDataObject; import net.osmand.binary.RouteDataObject;
import net.osmand.data.MapObject;
import net.osmand.data.QuadRect;
import net.osmand.render.RenderingRuleSearchRequest; import net.osmand.render.RenderingRuleSearchRequest;
import net.osmand.render.RenderingRulesStorage; import net.osmand.render.RenderingRulesStorage;
import net.osmand.router.PrecalculatedRouteDirection; import net.osmand.router.PrecalculatedRouteDirection;
@ -169,6 +173,12 @@ public class NativeLibrary {
String msgIfNothingFound); String msgIfNothingFound);
protected static native boolean initFontType(byte[] byteData, String name, boolean bold, boolean italic); protected static native boolean initFontType(byte[] byteData, String name, boolean bold, boolean italic);
protected static native RenderedObject[] searchRenderedObjects(RenderingContext context, int x, int y);
public RenderedObject[] searchRenderedObjectsFromContext(RenderingContext context, int x, int y) {
return searchRenderedObjects(context, x, y);
}
/**/ /**/
// Empty native impl // Empty native impl
@ -336,5 +346,41 @@ public class NativeLibrary {
public static class RenderedObject extends MapObject {
private Map<String, String> tags = new LinkedHashMap<>();
private QuadRect bbox = new QuadRect();
private int x;
private int y;
public Map<String, String> getTags() {
return tags;
}
public boolean isText() {
return !getName().isEmpty();
}
public void setLocation(int x, int y) {
this.x = x;
this.y = y;
}
public void setBbox(int left, int top, int right, int bottom) {
bbox = new QuadRect(left, top, right, bottom);
}
public QuadRect getBbox() {
return bbox;
}
public void setNativeId(long id) {
setId(id);
}
public void putTag(String t, String v) {
tags.put(t, v);
}
}
} }

View file

@ -67,5 +67,10 @@ public class QuadRect {
right -= dx; right -= dx;
bottom -= dy; bottom -= dy;
} }
@Override
public String toString() {
return "[" + (float) left + "," + (float) top + " - " + (float) right + "," + (float) bottom + "]";
}
} }