aboutsummaryrefslogtreecommitdiffstats
path: root/client/src
diff options
context:
space:
mode:
Diffstat (limited to 'client/src')
-rw-r--r--client/src/com/vaadin/client/ui/calendar/schedule/DateCellDayEvent.java9
-rw-r--r--client/src/com/vaadin/client/ui/calendar/schedule/SimpleDayCell.java7
2 files changed, 12 insertions, 4 deletions
diff --git a/client/src/com/vaadin/client/ui/calendar/schedule/DateCellDayEvent.java b/client/src/com/vaadin/client/ui/calendar/schedule/DateCellDayEvent.java
index 1a54fe0454..55834397d3 100644
--- a/client/src/com/vaadin/client/ui/calendar/schedule/DateCellDayEvent.java
+++ b/client/src/com/vaadin/client/ui/calendar/schedule/DateCellDayEvent.java
@@ -268,8 +268,13 @@ public class DateCellDayEvent extends FocusableHTML implements
}
int endX = event.getClientX();
int endY = event.getClientY();
- int xDiff = startX - endX;
- int yDiff = startY - endY;
+ int xDiff = 0, yDiff = 0;
+ if (startX != -1 && startY != -1) {
+ // Drag started
+ xDiff = startX - endX;
+ yDiff = startY - endY;
+ }
+
startX = -1;
startY = -1;
mouseMoveStarted = false;
diff --git a/client/src/com/vaadin/client/ui/calendar/schedule/SimpleDayCell.java b/client/src/com/vaadin/client/ui/calendar/schedule/SimpleDayCell.java
index 3bf6930933..158241337b 100644
--- a/client/src/com/vaadin/client/ui/calendar/schedule/SimpleDayCell.java
+++ b/client/src/com/vaadin/client/ui/calendar/schedule/SimpleDayCell.java
@@ -392,8 +392,11 @@ public class SimpleDayCell extends FocusableFlowPanel implements
int endX = event.getClientX();
int endY = event.getClientY();
- int xDiff = startX - endX;
- int yDiff = startY - endY;
+ int xDiff = 0, yDiff = 0;
+ if (startX != -1 && startY != -1) {
+ xDiff = startX - endX;
+ yDiff = startY - endY;
+ }
startX = -1;
startY = -1;
prevDayDiff = 0;