diff options
Diffstat (limited to 'android/source/src/java/org/libreoffice/canvas/SelectionHandleMiddle.java')
-rw-r--r-- | android/source/src/java/org/libreoffice/canvas/SelectionHandleMiddle.java | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/android/source/src/java/org/libreoffice/canvas/SelectionHandleMiddle.java b/android/source/src/java/org/libreoffice/canvas/SelectionHandleMiddle.java new file mode 100644 index 000000000..76bdf9110 --- /dev/null +++ b/android/source/src/java/org/libreoffice/canvas/SelectionHandleMiddle.java @@ -0,0 +1,34 @@ +package org.libreoffice.canvas; + +import org.libreoffice.LibreOfficeMainActivity; + +import org.libreoffice.R; + +/** + * Selection handle that is used to manipulate the cursor. + */ +public class SelectionHandleMiddle extends SelectionHandle { + public SelectionHandleMiddle(LibreOfficeMainActivity context) { + super(context, getBitmapForDrawable(context, R.drawable.handle_alias_middle)); + } + + /** + * Change the position of the handle on the screen. Take into account the + * handle alignment to the center. + */ + @Override + public void reposition(float x, float y) { + super.reposition(x, y); + // align to the center + float offset = mScreenPosition.width() / 2.0f; + mScreenPosition.offset(-offset, 0); + } + + /** + * Define the type of the handle. + */ + @Override + public HandleType getHandleType() { + return HandleType.MIDDLE; + } +} |