Просмотр исходного кода

Helper methods for drag

svn changeset:17329/svn branch:6.6
tags/6.7.0.beta1
Matti Tahvonen 13 лет назад
Родитель
Сommit
7756ba04dc
1 измененных файлов: 32 добавлений и 0 удалений
  1. 32
    0
      src/com/vaadin/terminal/gwt/client/Util.java

+ 32
- 0
src/com/vaadin/terminal/gwt/client/Util.java Просмотреть файл

@@ -1041,4 +1041,36 @@ public class Util {

}

/**
* A helper method to return the client position from an event. Returns
* position from either first changed touch (if touch event) or from the
* event itself.
*
* @param event
* @return
*/
public static int getTouchOrMouseClientX(Event event) {
if ((event.getTypeInt() & Event.TOUCHEVENTS) > 0) {
return event.getChangedTouches().get(0).getClientX();
} else {
return event.getClientX();
}
}

/**
* A helper method to return the client position from an event. Returns
* position from either first changed touch (if touch event) or from the
* event itself.
*
* @param event
* @return
*/
public static int getTouchOrMouseClientY(Event event) {
if ((event.getTypeInt() & Event.TOUCHEVENTS) > 0) {
return event.getChangedTouches().get(0).getClientY();
} else {
return event.getClientY();
}
}

}

Загрузка…
Отмена
Сохранить