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
324a2168
Unverified
Commit
324a2168
authored
Feb 07, 2020
by
Tong Mu
Committed by
GitHub
Feb 07, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change definition of offset to object (#50157)
parent
26271223
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
8 deletions
+7
-8
layer.dart
packages/flutter/lib/src/rendering/layer.dart
+6
-7
layer_annotations_test.dart
packages/flutter/test/rendering/layer_annotations_test.dart
+1
-1
No files found.
packages/flutter/lib/src/rendering/layer.dart
View file @
324a2168
...
...
@@ -30,8 +30,8 @@ class AnnotationEntry<T> {
/// The annotation object that is found.
final
T
annotation
;
/// The target location described by the local coordinate space of the
layer
///
that contains the annotation
.
/// The target location described by the local coordinate space of the
///
annotation object
.
final
Offset
localPosition
;
@override
...
...
@@ -2470,16 +2470,15 @@ class AnnotatedRegionLayer<T> extends ContainerLayer {
/// met.
final
T
value
;
/// The size of an optional clipping rectangle, used to control whether a
/// position is contained by the annotation.
/// The size of the annotated object.
///
/// If [size] is provided, then the annotation is
only added
if the target
/// If [size] is provided, then the annotation is
found only
if the target
/// position is contained by the rectangle formed by [size] and [offset].
/// Otherwise no such restriction is applied, and clipping can only be done by
/// the ancestor layers.
final
Size
size
;
/// The
offset of the optional clipping rectangle that is indicated by [size]
.
/// The
position of the annotated object
.
///
/// The [offset] defaults to [Offset.zero] if not provided, and is ignored if
/// [size] is not set.
...
...
@@ -2549,7 +2548,7 @@ class AnnotatedRegionLayer<T> extends ContainerLayer {
final
S
typedValue
=
untypedValue
as
S
;
result
.
add
(
AnnotationEntry
<
S
>(
annotation:
typedValue
,
localPosition:
localPosition
,
localPosition:
localPosition
-
offset
,
));
}
return
isAbsorbed
;
...
...
packages/flutter/test/rendering/layer_annotations_test.dart
View file @
324a2168
...
...
@@ -690,7 +690,7 @@ void main() {
root
.
findAllAnnotations
<
int
>(
position
).
entries
.
toList
(),
_equalToAnnotationResult
<
int
>(<
AnnotationEntry
<
int
>>[
const
AnnotationEntry
<
int
>(
annotation:
2
,
localPosition:
position
),
const
AnnotationEntry
<
int
>(
annotation:
1
,
localPosition:
position
),
const
AnnotationEntry
<
int
>(
annotation:
1
,
localPosition:
Offset
(
10
,
10
)
),
const
AnnotationEntry
<
int
>(
annotation:
1000
,
localPosition:
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