Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
7c105e6b
Commit
7c105e6b
authored
Feb 16, 2016
by
Adam Barth
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1928 from abarth/move_to_up
Enforce that we get a final move to the pointer up location
parents
0a813898
ddd58c5e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
0 deletions
+30
-0
converter.dart
packages/flutter/lib/src/gestures/converter.dart
+30
-0
No files found.
packages/flutter/lib/src/gestures/converter.dart
View file @
7c105e6b
...
...
@@ -121,6 +121,36 @@ class PointerEventConverter {
assert
(
_pointers
.
containsKey
(
datum
.
pointer
));
_PointerState
state
=
_pointers
[
datum
.
pointer
];
assert
(
state
.
down
);
if
(
position
!=
state
.
lastPosition
)
{
// Not all sources of pointer packets respect the invariant that
// they move the pointer to the up location before sending the up
// event. For example, in the iOS simulator, of you drag outside the
// window, you'll get a stream of pointers that violates that
// invariant. We restore the invariant here for our clients.
Offset
offset
=
position
-
state
.
lastPosition
;
state
.
lastPosition
=
position
;
yield
new
PointerMoveEvent
(
timeStamp:
timeStamp
,
pointer:
state
.
pointer
,
kind:
kind
,
position:
position
,
delta:
offset
,
down:
state
.
down
,
obscured:
datum
.
obscured
,
pressure:
datum
.
pressure
,
pressureMin:
datum
.
pressureMin
,
pressureMax:
datum
.
pressureMax
,
distance:
datum
.
distance
,
distanceMax:
datum
.
distanceMax
,
radiusMajor:
datum
.
radiusMajor
,
radiusMinor:
datum
.
radiusMajor
,
radiusMin:
datum
.
radiusMin
,
radiusMax:
datum
.
radiusMax
,
orientation:
datum
.
orientation
,
tilt:
datum
.
tilt
);
state
.
lastPosition
=
position
;
}
assert
(
position
==
state
.
lastPosition
);
state
.
setUp
();
if
(
datum
.
type
==
mojom
.
PointerType
.
up
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment