Also start the preview when dragging in another direction.
http://jsperf.com/nested-objects-math-abs
This commit is contained in:
Lightforger
2013-05-02 05:43:59 +03:00
parent 6f42023c5c
commit c0afec255c

View File

@@ -467,7 +467,7 @@ Danbooru.Note = {
Danbooru.Note.TranslationMode.Drag.dragDistanceX = e.pageX - Danbooru.Note.TranslationMode.Drag.dragStartX;
Danbooru.Note.TranslationMode.Drag.dragDistanceY = e.pageY - Danbooru.Note.TranslationMode.Drag.dragStartY;
if (Danbooru.Note.TranslationMode.Drag.dragDistanceX > 9 && Danbooru.Note.TranslationMode.Drag.dragDistanceY > 9) {
if (Math.abs(Danbooru.Note.TranslationMode.Drag.dragDistanceX) > 9 && Math.abs(Danbooru.Note.TranslationMode.Drag.dragDistanceY) > 9) {
Danbooru.Note.TranslationMode.Drag.dragging = true; /* must drag at least 10pixels (minimum note size) in both dimensions. */
}
if (Danbooru.Note.TranslationMode.Drag.dragging) {