Loading core/java/com/android/internal/widget/PointerLocationView.java +13 −10 Original line number Diff line number Diff line Loading @@ -163,6 +163,8 @@ public class PointerLocationView extends View implements InputDeviceListener, @UnsupportedAppUsage private boolean mPrintCoords = true; private float mDensity; public PointerLocationView(Context c) { super(c); setFocusableInTouchMode(true); Loading Loading @@ -357,19 +359,20 @@ public class PointerLocationView extends View implements InputDeviceListener, // Draw current touch ellipse. mPaint.setARGB(255, pressureLevel, 255 - pressureLevel, 128); drawOval(canvas, ps.mCoords.x, ps.mCoords.y, ps.mCoords.touchMajor, ps.mCoords.touchMinor, ps.mCoords.orientation, mPaint); drawOval(canvas, ps.mCoords.x, ps.mCoords.y, ps.mCoords.touchMajor * mDensity, ps.mCoords.touchMinor * mDensity, ps.mCoords.orientation, mPaint); // Draw current tool ellipse. mPaint.setARGB(255, pressureLevel, 128, 255 - pressureLevel); drawOval(canvas, ps.mCoords.x, ps.mCoords.y, ps.mCoords.toolMajor, ps.mCoords.toolMinor, ps.mCoords.orientation, mPaint); drawOval(canvas, ps.mCoords.x, ps.mCoords.y, ps.mCoords.toolMajor * mDensity, ps.mCoords.toolMinor * mDensity, ps.mCoords.orientation, mPaint); // Draw the orientation arrow. float arrowSize = ps.mCoords.toolMajor * 0.7f; if (arrowSize < 20) { arrowSize = 20; } arrowSize *= mDensity; mPaint.setARGB(255, pressureLevel, 255, 0); float orientationVectorX = (float) (Math.sin(ps.mCoords.orientation) * arrowSize); Loading Loading @@ -398,7 +401,7 @@ public class PointerLocationView extends View implements InputDeviceListener, canvas.drawCircle( ps.mCoords.x + orientationVectorX * tiltScale, ps.mCoords.y + orientationVectorY * tiltScale, 3.0f, mPaint); 3.0f * mDensity, mPaint); // Draw the current bounding box if (ps.mHasBoundingBox) { Loading Loading @@ -1003,10 +1006,10 @@ public class PointerLocationView extends View implements InputDeviceListener, // Compute size by display density. private void configureDensityDependentFactors() { final float density = getResources().getDisplayMetrics().density; mTextPaint.setTextSize(10 * density); mPaint.setStrokeWidth(1 * density); mCurrentPointPaint.setStrokeWidth(1 * density); mPathPaint.setStrokeWidth(1 * density); mDensity = getResources().getDisplayMetrics().density; mTextPaint.setTextSize(10 * mDensity); mPaint.setStrokeWidth(1 * mDensity); mCurrentPointPaint.setStrokeWidth(1 * mDensity); mPathPaint.setStrokeWidth(1 * mDensity); } } Loading
core/java/com/android/internal/widget/PointerLocationView.java +13 −10 Original line number Diff line number Diff line Loading @@ -163,6 +163,8 @@ public class PointerLocationView extends View implements InputDeviceListener, @UnsupportedAppUsage private boolean mPrintCoords = true; private float mDensity; public PointerLocationView(Context c) { super(c); setFocusableInTouchMode(true); Loading Loading @@ -357,19 +359,20 @@ public class PointerLocationView extends View implements InputDeviceListener, // Draw current touch ellipse. mPaint.setARGB(255, pressureLevel, 255 - pressureLevel, 128); drawOval(canvas, ps.mCoords.x, ps.mCoords.y, ps.mCoords.touchMajor, ps.mCoords.touchMinor, ps.mCoords.orientation, mPaint); drawOval(canvas, ps.mCoords.x, ps.mCoords.y, ps.mCoords.touchMajor * mDensity, ps.mCoords.touchMinor * mDensity, ps.mCoords.orientation, mPaint); // Draw current tool ellipse. mPaint.setARGB(255, pressureLevel, 128, 255 - pressureLevel); drawOval(canvas, ps.mCoords.x, ps.mCoords.y, ps.mCoords.toolMajor, ps.mCoords.toolMinor, ps.mCoords.orientation, mPaint); drawOval(canvas, ps.mCoords.x, ps.mCoords.y, ps.mCoords.toolMajor * mDensity, ps.mCoords.toolMinor * mDensity, ps.mCoords.orientation, mPaint); // Draw the orientation arrow. float arrowSize = ps.mCoords.toolMajor * 0.7f; if (arrowSize < 20) { arrowSize = 20; } arrowSize *= mDensity; mPaint.setARGB(255, pressureLevel, 255, 0); float orientationVectorX = (float) (Math.sin(ps.mCoords.orientation) * arrowSize); Loading Loading @@ -398,7 +401,7 @@ public class PointerLocationView extends View implements InputDeviceListener, canvas.drawCircle( ps.mCoords.x + orientationVectorX * tiltScale, ps.mCoords.y + orientationVectorY * tiltScale, 3.0f, mPaint); 3.0f * mDensity, mPaint); // Draw the current bounding box if (ps.mHasBoundingBox) { Loading Loading @@ -1003,10 +1006,10 @@ public class PointerLocationView extends View implements InputDeviceListener, // Compute size by display density. private void configureDensityDependentFactors() { final float density = getResources().getDisplayMetrics().density; mTextPaint.setTextSize(10 * density); mPaint.setStrokeWidth(1 * density); mCurrentPointPaint.setStrokeWidth(1 * density); mPathPaint.setStrokeWidth(1 * density); mDensity = getResources().getDisplayMetrics().density; mTextPaint.setTextSize(10 * mDensity); mPaint.setStrokeWidth(1 * mDensity); mCurrentPointPaint.setStrokeWidth(1 * mDensity); mPathPaint.setStrokeWidth(1 * mDensity); } }