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
b1448e0f
Commit
b1448e0f
authored
Dec 08, 2015
by
Ian Hickson
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #810 from Hixie/pointers
Clean up pointer handling.
parents
8083c2d4
7514ce12
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
6 deletions
+7
-6
binding.dart
packages/flutter/lib/src/rendering/binding.dart
+7
-6
No files found.
packages/flutter/lib/src/rendering/binding.dart
View file @
b1448e0f
...
@@ -56,10 +56,12 @@ class _PointerEventConverter {
...
@@ -56,10 +56,12 @@ class _PointerEventConverter {
PointerDeviceKind
kind
=
_pointerKindMap
[
datum
.
kind
];
PointerDeviceKind
kind
=
_pointerKindMap
[
datum
.
kind
];
switch
(
datum
.
type
)
{
switch
(
datum
.
type
)
{
case
PointerType
.
DOWN
:
case
PointerType
.
DOWN
:
assert
(!
_pointers
.
containsKey
(
datum
.
pointer
));
_PointerState
state
=
_pointers
.
putIfAbsent
(
_PointerState
state
=
_pointers
.
putIfAbsent
(
datum
.
pointer
,
datum
.
pointer
,
()
=>
new
_PointerState
(
position
)
()
=>
new
_PointerState
(
position
)
);
);
assert
(
state
.
lastPosition
==
position
);
state
.
startNewPointer
();
state
.
startNewPointer
();
state
.
setDown
();
state
.
setDown
();
yield
new
PointerAddedEvent
(
yield
new
PointerAddedEvent
(
...
@@ -96,13 +98,11 @@ class _PointerEventConverter {
...
@@ -96,13 +98,11 @@ class _PointerEventConverter {
);
);
break
;
break
;
case
PointerType
.
MOVE
:
case
PointerType
.
MOVE
:
_PointerState
state
=
_pointers
[
datum
.
pointer
];
// If the service starts supporting hover pointers, then it must also
// If the service starts supporting hover pointers, then it must also
// start sending us ADDED and REMOVED data points. In the meantime, we
// start sending us ADDED and REMOVED data points.
// only support "down" moves, and ignore spurious moves.
// See also: https://github.com/flutter/flutter/issues/720
// See also: https://github.com/flutter/flutter/issues/720
if
(
state
==
null
)
assert
(
_pointers
.
containsKey
(
datum
.
pointer
));
break
;
_PointerState
state
=
_pointers
[
datum
.
pointer
]
;
assert
(
state
.
down
);
assert
(
state
.
down
);
Offset
offset
=
position
-
state
.
lastPosition
;
Offset
offset
=
position
-
state
.
lastPosition
;
state
.
lastPosition
=
position
;
state
.
lastPosition
=
position
;
...
@@ -129,8 +129,9 @@ class _PointerEventConverter {
...
@@ -129,8 +129,9 @@ class _PointerEventConverter {
break
;
break
;
case
PointerType
.
UP
:
case
PointerType
.
UP
:
case
PointerType
.
CANCEL
:
case
PointerType
.
CANCEL
:
assert
(
_pointers
.
containsKey
(
datum
.
pointer
));
_PointerState
state
=
_pointers
[
datum
.
pointer
];
_PointerState
state
=
_pointers
[
datum
.
pointer
];
assert
(
state
!=
null
);
assert
(
state
.
down
);
assert
(
position
==
state
.
lastPosition
);
assert
(
position
==
state
.
lastPosition
);
state
.
setUp
();
state
.
setUp
();
if
(
datum
.
type
==
PointerType
.
UP
)
{
if
(
datum
.
type
==
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