Code example for PointF

Methods: offset

0
		mZoomController = new ZoomController(getContext(), mController, zoomControls);
		ObjectRelation.addRelation(this, zoomControls);
	}	 
	 
	public float getCenterPositionAndScale(PointF position) {
		float scale = mController.getPositionAndScale(position);
		float width = getWidth() / scale;
		float height = getHeight() / scale;
		position.offset(width/2,height/2);
		ObjectRelation.addRelation(this, position);
		return scale;
	} 
	 
	public void setCenterPositionAndScale(PointF position, Float zoom, boolean animated) {
		if(!animated){
			mChangeCenterPoint = position;
			mChangeScale = zoom;
			invalidate();
		}else{ 
			mController.doScrollAndZoomAnimation(position, zoom);
		}