Page MenuHomeWildfire Games

Change drag operations
ClosedPublic

Authored by OptimusShepard on Feb 8 2018, 8:31 PM.

Details

Summary

Change drag operations from array to vector, also use vectorfunctions and gobal variables.

Test Plan

test some drag operations like bandbox or house rotation

Diff Detail

Repository
rP 0 A.D. Public Repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

OptimusShepard created this revision.Feb 8 2018, 8:31 PM
Imarok added a subscriber: Imarok.Feb 8 2018, 11:15 PM
Imarok added inline comments.
binaries/data/mods/public/gui/session/input.js
43 ↗(On Diff #5723)

You can do that better.

536 ↗(On Diff #5723)

Notice this changes the behaviour.
Same for the other ones

Imarok added inline comments.Feb 8 2018, 11:27 PM
binaries/data/mods/public/gui/session/input.js
681 ↗(On Diff #5723)

abs unneeded. Same for the rest.

Vulcan added a subscriber: Vulcan.Feb 8 2018, 11:28 PM

Successful build - Chance fights ever on the side of the prudent.

Updating workspaces...
Build (release)...
Build (debug)...
Running release tests...
Running cxxtest tests (309 tests).....................................................................................................................................................................................................................................................................................................................OK!
Running debug tests...
Running cxxtest tests (309 tests).....................................................................................................................................................................................................................................................................................................................OK!
Checking XML files...

fix comments

Imarok added inline comments.Feb 8 2018, 11:36 PM
binaries/data/mods/public/gui/session/input.js
550 ↗(On Diff #5731)

inline dragDelta?

OptimusShepard marked 4 inline comments as done.Feb 8 2018, 11:40 PM
Imarok accepted this revision.Feb 8 2018, 11:50 PM
This revision is now accepted and ready to land.Feb 8 2018, 11:50 PM
This revision was automatically updated to reflect the committed changes.
Owners added a subscriber: Restricted Owners Package.Feb 9 2018, 12:11 AM
elexis added inline comments.Feb 9 2018, 12:11 AM
binaries/data/mods/public/gui/session/input.js
371 ↗(On Diff #5732)

Is that Vector2D.max(g_DragStart, ev) ?

Imarok added inline comments.Feb 9 2018, 12:14 AM
binaries/data/mods/public/gui/session/input.js
371 ↗(On Diff #5732)

nearly.
it's

v0 = Vector2D.min(g_DragStart, ev);
v1 = Vector2D.max(g_DragStart, ev);
Vulcan added a comment.Feb 9 2018, 2:27 AM

Build failure - The Moirai have given mortals hearts that can endure.

Vulcan added a comment.Feb 9 2018, 3:21 AM

Build failure - The Moirai have given mortals hearts that can endure.

elexis added inline comments.Feb 11 2018, 1:14 PM
binaries/data/mods/public/gui/session/input.js
371 ↗(On Diff #5732)

Can someone fix it? 2 lines seem considerably easier than 16 (I wouldn't be surprised if it's even faster, though the performance is negligible I expect)