- public void onScaleEnd(ScaleGestureDetector detector) {
- AltosDebug.debug("onScaleEnd %f\n", detector.getScaleFactor());
- }
-
- @Override
- public boolean dispatchTouchEvent(MotionEvent event) {
- scale_detector.onTouchEvent(event);
-
- if (scale_detector.isInProgress()) {
- scaling = true;
- }
-
- if (scaling) {
- if(AltosDebug.D) AltosDebug.debug("scale in progress\n");
- if (event.getAction() == MotionEvent.ACTION_UP) {
- AltosDebug.debug("scale finished\n");
- scaling = false;
- }
- return true;
- }
-
- if (event.getAction() == MotionEvent.ACTION_DOWN) {
- AltosDebug.debug("down event %g %g\n", event.getX(), event.getY());
- map.touch_start((int) event.getX(), (int) event.getY(), true);
- } else if (event.getAction() == MotionEvent.ACTION_MOVE) {
- AltosDebug.debug("continue event %g %g\n", event.getX(), event.getY());
- map.touch_continue((int) event.getX(), (int) event.getY(), true);
- }
- return true;
- }
-
- public MapView(Context context) {
- super(context);
- scale_detector = new ScaleGestureDetector(this.getContext(), this);
+ float x = pt.x;
+ float y = pt.y;
+ x = x - width / 2.0f - off_x;
+ y = y + height / 2.0f - off_y;
+ paint.setColor(0xff000000);
+ canvas.drawText(text, 0, text.length(), x, y, paint);