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
fc483788
Commit
fc483788
authored
Jul 30, 2015
by
Adam Barth
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #372 from abarth/fix_sporadic_crash
Sporadic crash from invalid touch event
parents
456e17d0
3c14e41b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
17 deletions
+13
-17
sky_binding.dart
packages/flutter/lib/rendering/sky_binding.dart
+13
-17
No files found.
packages/flutter/lib/rendering/sky_binding.dart
View file @
fc483788
...
...
@@ -102,27 +102,23 @@ class SkyBinding {
return
state
;
}
PointerState
_getOrCreateStateForPointer
(
event
,
position
)
{
PointerState
state
=
_stateForPointer
[
event
.
pointer
];
if
(
state
==
null
)
state
=
_createStateForPointer
(
event
,
position
);
return
state
;
}
void
_handlePointerEvent
(
sky
.
PointerEvent
event
)
{
Point
position
=
new
Point
(
event
.
x
,
event
.
y
);
PointerState
state
;
switch
(
event
.
type
)
{
case
'pointerdown'
:
state
=
_createStateForPointer
(
event
,
position
);
break
;
case
'pointerup'
:
case
'pointercancel'
:
state
=
_stateForPointer
[
event
.
pointer
];
PointerState
state
=
_getOrCreateStateForPointer
(
event
,
position
);
if
(
event
.
type
==
'pointerup'
||
event
.
type
==
'pointercancel'
)
{
if
(
_hammingWeight
(
event
.
buttons
)
<=
1
)
_stateForPointer
.
remove
(
event
.
pointer
);
break
;
case
'pointermove'
:
state
=
_stateForPointer
[
event
.
pointer
];
// In the case of mouse hover we won't already have a cached down.
if
(
state
==
null
)
state
=
_createStateForPointer
(
event
,
position
);
break
;
}
event
.
dx
=
position
.
x
-
state
.
lastPosition
.
x
;
event
.
dy
=
position
.
y
-
state
.
lastPosition
.
y
;
state
.
lastPosition
=
position
;
...
...
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