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
c606f044
Unverified
Commit
c606f044
authored
Oct 12, 2020
by
Jonah Williams
Committed by
GitHub
Oct 12, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[gestures] make stylus pointer types use touch pan/drag slop (#67885)
parent
b6c56fde
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
9 deletions
+9
-9
events.dart
packages/flutter/lib/src/gestures/events.dart
+3
-3
events_test.dart
packages/flutter/test/gestures/events_test.dart
+6
-6
No files found.
packages/flutter/lib/src/gestures/events.dart
View file @
c606f044
...
...
@@ -2115,9 +2115,9 @@ class PointerCancelEvent extends PointerEvent with _PointerEventDescription, _Co
double
computeHitSlop
(
PointerDeviceKind
kind
)
{
switch
(
kind
)
{
case
PointerDeviceKind
.
mouse
:
return
kPrecisePointerHitSlop
;
case
PointerDeviceKind
.
stylus
:
case
PointerDeviceKind
.
invertedStylus
:
return
kPrecisePointerHitSlop
;
case
PointerDeviceKind
.
unknown
:
case
PointerDeviceKind
.
touch
:
return
kTouchSlop
;
...
...
@@ -2128,9 +2128,9 @@ double computeHitSlop(PointerDeviceKind kind) {
double
computePanSlop
(
PointerDeviceKind
kind
)
{
switch
(
kind
)
{
case
PointerDeviceKind
.
mouse
:
return
kPrecisePointerPanSlop
;
case
PointerDeviceKind
.
stylus
:
case
PointerDeviceKind
.
invertedStylus
:
return
kPrecisePointerPanSlop
;
case
PointerDeviceKind
.
unknown
:
case
PointerDeviceKind
.
touch
:
return
kPanSlop
;
...
...
@@ -2141,9 +2141,9 @@ double computePanSlop(PointerDeviceKind kind) {
double
computeScaleSlop
(
PointerDeviceKind
kind
)
{
switch
(
kind
)
{
case
PointerDeviceKind
.
mouse
:
return
kPrecisePointerScaleSlop
;
case
PointerDeviceKind
.
stylus
:
case
PointerDeviceKind
.
invertedStylus
:
return
kPrecisePointerScaleSlop
;
case
PointerDeviceKind
.
unknown
:
case
PointerDeviceKind
.
touch
:
return
kScaleSlop
;
...
...
packages/flutter/test/gestures/events_test.dart
View file @
c606f044
...
...
@@ -38,20 +38,20 @@ void main() {
test
(
'computed hit slop values are based on pointer device kind'
,
()
{
expect
(
computeHitSlop
(
PointerDeviceKind
.
mouse
),
kPrecisePointerHitSlop
);
expect
(
computeHitSlop
(
PointerDeviceKind
.
stylus
),
k
PrecisePointerHit
Slop
);
expect
(
computeHitSlop
(
PointerDeviceKind
.
invertedStylus
),
k
PrecisePointerHit
Slop
);
expect
(
computeHitSlop
(
PointerDeviceKind
.
stylus
),
k
Touch
Slop
);
expect
(
computeHitSlop
(
PointerDeviceKind
.
invertedStylus
),
k
Touch
Slop
);
expect
(
computeHitSlop
(
PointerDeviceKind
.
touch
),
kTouchSlop
);
expect
(
computeHitSlop
(
PointerDeviceKind
.
unknown
),
kTouchSlop
);
expect
(
computePanSlop
(
PointerDeviceKind
.
mouse
),
kPrecisePointerPanSlop
);
expect
(
computePanSlop
(
PointerDeviceKind
.
stylus
),
kP
recisePointerP
anSlop
);
expect
(
computePanSlop
(
PointerDeviceKind
.
invertedStylus
),
kP
recisePointerP
anSlop
);
expect
(
computePanSlop
(
PointerDeviceKind
.
stylus
),
kPanSlop
);
expect
(
computePanSlop
(
PointerDeviceKind
.
invertedStylus
),
kPanSlop
);
expect
(
computePanSlop
(
PointerDeviceKind
.
touch
),
kPanSlop
);
expect
(
computePanSlop
(
PointerDeviceKind
.
unknown
),
kPanSlop
);
expect
(
computeScaleSlop
(
PointerDeviceKind
.
mouse
),
kPrecisePointerScaleSlop
);
expect
(
computeScaleSlop
(
PointerDeviceKind
.
stylus
),
k
PrecisePointer
ScaleSlop
);
expect
(
computeScaleSlop
(
PointerDeviceKind
.
invertedStylus
),
k
PrecisePointer
ScaleSlop
);
expect
(
computeScaleSlop
(
PointerDeviceKind
.
stylus
),
kScaleSlop
);
expect
(
computeScaleSlop
(
PointerDeviceKind
.
invertedStylus
),
kScaleSlop
);
expect
(
computeScaleSlop
(
PointerDeviceKind
.
touch
),
kScaleSlop
);
expect
(
computeScaleSlop
(
PointerDeviceKind
.
unknown
),
kScaleSlop
);
});
...
...
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