Bug 1017242 - Part C: remove API 8 code from GeckoEvent. r=mfinkle

This commit is contained in:
Richard Newman 2014-07-18 16:47:10 -07:00
parent 132e78d797
commit 25edd0e517

View File

@ -470,8 +470,7 @@ public class GeckoEvent {
mPoints[index] = new Point(Math.round(geckoPoint.x), Math.round(geckoPoint.y));
mPointIndicies[index] = event.getPointerId(eventIndex);
// getToolMajor, getToolMinor and getOrientation are API Level 9 features
if (Build.VERSION.SDK_INT >= 9) {
double radians = event.getOrientation(eventIndex);
mOrientations[index] = (float) Math.toDegrees(radians);
// w3c touchevents spec does not allow orientations == 90
@ -494,14 +493,7 @@ public class GeckoEvent {
mPointRadii[index] = new Point((int)event.getToolMinor(eventIndex)/2,
(int)event.getToolMajor(eventIndex)/2);
}
} else {
float size = event.getSize(eventIndex);
Resources resources = GeckoAppShell.getContext().getResources();
DisplayMetrics displaymetrics = resources.getDisplayMetrics();
size = size*Math.min(displaymetrics.heightPixels, displaymetrics.widthPixels);
mPointRadii[index] = new Point((int)size,(int)size);
mOrientations[index] = 0;
}
if (!keepInViewCoordinates) {
// If we are converting to gecko CSS pixels, then we should adjust the
// radii as well