Update git submodules
[LibreOffice.git] / android / source / src / java / org / libreoffice / canvas / SelectionHandleMiddle.java
blob76bdf9110acc53a7d30c37a71b2a901ae69ef5a2
1 package org.libreoffice.canvas;
3 import org.libreoffice.LibreOfficeMainActivity;
5 import org.libreoffice.R;
7 /**
8 * Selection handle that is used to manipulate the cursor.
9 */
10 public class SelectionHandleMiddle extends SelectionHandle {
11 public SelectionHandleMiddle(LibreOfficeMainActivity context) {
12 super(context, getBitmapForDrawable(context, R.drawable.handle_alias_middle));
15 /**
16 * Change the position of the handle on the screen. Take into account the
17 * handle alignment to the center.
19 @Override
20 public void reposition(float x, float y) {
21 super.reposition(x, y);
22 // align to the center
23 float offset = mScreenPosition.width() / 2.0f;
24 mScreenPosition.offset(-offset, 0);
27 /**
28 * Define the type of the handle.
30 @Override
31 public HandleType getHandleType() {
32 return HandleType.MIDDLE;