-
Notifications
You must be signed in to change notification settings - Fork 87
Android build #1804
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Android build #1804
Changes from 1 commit
d41850d
7212e35
154dbc4
b9c1b8f
48e4345
ebb1b78
b536a73
81098a6
2992c4a
107d540
4988c05
4e32c59
821db6f
82cca08
152da4c
a9e90cd
1ca1b58
73004a5
8d00021
bb0f187
c3507f0
9c0b200
7d5c270
62d71ba
f14d60d
1556dcc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -26,6 +26,9 @@ | |
| #include "s25util/MyTime.h" | ||
| #include <algorithm> | ||
|
|
||
| // Calc square | ||
| #define SQR(x) ((x) * (x)) | ||
Flamefire marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| WindowManager::WindowManager() | ||
| : cursor_(Cursor::Hand), disable_mouse(false), lastMousePos(Position::Invalid()), curRenderSize(0, 0), | ||
| lastLeftClickTime(0), lastLeftClickPos(0, 0) | ||
|
|
@@ -357,24 +360,23 @@ void WindowManager::Msg_LeftUp(MouseCoords mc) | |
| // Ggf. Doppelklick untersuche | ||
| unsigned time_now = VIDEODRIVER.GetTickCount(); | ||
|
|
||
| // Sehr schwierig auf touch mit dem default dbl-click interval z.B. Mails zu löschen ohne das Fenster zu schließen | ||
| if(time_now - lastLeftClickTime < (VIDEODRIVER.IsTouch() ? DOUBLE_CLICK_INTERVAL / 3 : DOUBLE_CLICK_INTERVAL)) | ||
| if(!VIDEODRIVER.IsTouch()) | ||
Flamefire marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| { | ||
| if(mc.GetPos() == lastLeftClickPos) | ||
| if(time_now - lastLeftClickTime < DOUBLE_CLICK_INTERVAL && mc.pos == lastLeftClickPos) | ||
| mc.dbl_click = true; | ||
|
|
||
| } else if(time_now - lastLeftClickTime < TOUCH_DOUBLE_CLICK_INTERVAL) | ||
| { | ||
| // Calculate distance between two points | ||
| unsigned cDistance = SQR(mc.pos.x - lastLeftClickPos.x) + SQR(mc.pos.y - lastLeftClickPos.y); | ||
|
||
| if(cDistance <= SQR(TOUCH_MAX_DOUBLE_CLICK_DISTANCE)) | ||
| mc.dbl_click = true; | ||
| else if(VIDEODRIVER.IsTouch()) // Fast unmöglich 2 mal auf den exakt selben punkt zu tippen | ||
| { | ||
| // Wenn doppeltippen -> fenster schließen | ||
| IngameWindow* window = FindWindowAtPos(mc.GetPos()); | ||
| if(window && !window->IsPinned()) | ||
| window->Close(); | ||
| } | ||
| } | ||
|
|
||
| if(!mc.dbl_click) | ||
| { | ||
| // Werte wieder erneut speichern | ||
| lastLeftClickPos = mc.GetPos(); | ||
| // Save values for next potential dbl click | ||
| lastLeftClickPos = mc.pos; | ||
| lastLeftClickTime = time_now; | ||
| } | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That cast can't be verified at this point. Just do a ternary here to set the enum value directly. So you don't even need the comment
This will also throw an error if the value does not exist, so please keep the prior one with default value
I don't think you need the warning either as there is nothing to check: The old setting is translated 1:1 to the new one