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
e2c6ba1b
Commit
e2c6ba1b
authored
Sep 11, 2017
by
Michael Goderbauer
Committed by
GitHub
Sep 11, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve readability of _SemanticsGeometry (#12038)
parent
26751434
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
20 deletions
+27
-20
object.dart
packages/flutter/lib/src/rendering/object.dart
+27
-20
No files found.
packages/flutter/lib/src/rendering/object.dart
View file @
e2c6ba1b
...
...
@@ -547,45 +547,52 @@ typedef void RenderObjectVisitor(RenderObject child);
typedef
void
LayoutCallback
<
T
extends
Constraints
>(
T
constraints
);
class
_SemanticsGeometry
{
_SemanticsGeometry
()
:
transform
=
new
Matrix4
.
identity
();
_SemanticsGeometry
()
:
_transform
=
new
Matrix4
.
identity
();
_SemanticsGeometry
.
withClipFrom
(
_SemanticsGeometry
other
)
{
clipRect
=
other
?.
clipRect
;
transform
=
new
Matrix4
.
identity
();
_clipRect
=
other
?.
_
clipRect
;
_
transform
=
new
Matrix4
.
identity
();
}
_SemanticsGeometry
.
copy
(
_SemanticsGeometry
other
)
{
if
(
other
!=
null
)
{
clipRect
=
other
.
clipRect
;
transform
=
new
Matrix4
.
copy
(
other
.
transform
);
_clipRect
=
other
.
_
clipRect
;
_transform
=
new
Matrix4
.
copy
(
other
.
_
transform
);
}
else
{
transform
=
new
Matrix4
.
identity
();
_
transform
=
new
Matrix4
.
identity
();
}
}
Rect
clipRect
;
Rect
_clipRect
;
Rect
_intersectClipRect
(
Rect
other
)
{
if
(
clipRect
==
null
)
if
(
_
clipRect
==
null
)
return
other
;
if
(
other
==
null
)
return
clipRect
;
return
clipRect
.
intersect
(
other
);
return
_
clipRect
;
return
_
clipRect
.
intersect
(
other
);
}
Matrix4
transform
;
Matrix4
_transform
;
void
applyAncestorChain
(
List
<
RenderObject
>
ancestorChain
)
{
for
(
int
index
=
ancestorChain
.
length
-
1
;
index
>
0
;
index
-=
1
)
{
final
RenderObject
parent
=
ancestorChain
[
index
];
final
RenderObject
child
=
ancestorChain
[
index
-
1
];
clipRect
=
_intersectClipRect
(
parent
.
describeApproximatePaintClip
(
child
));
if
(
clipRect
!=
null
)
{
if
(
clipRect
.
isEmpty
)
{
clipRect
=
Rect
.
zero
;
_
clipRect
=
_intersectClipRect
(
parent
.
describeApproximatePaintClip
(
child
));
if
(
_
clipRect
!=
null
)
{
if
(
_
clipRect
.
isEmpty
)
{
_
clipRect
=
Rect
.
zero
;
}
else
{
final
Matrix4
clipTransform
=
new
Matrix4
.
identity
();
parent
.
applyPaintTransform
(
child
,
clipTransform
);
clipRect
=
MatrixUtils
.
inverseTransformRect
(
clipTransform
,
clipRect
);
_clipRect
=
MatrixUtils
.
inverseTransformRect
(
clipTransform
,
_
clipRect
);
}
}
parent
.
applyPaintTransform
(
child
,
transform
);
parent
.
applyPaintTransform
(
child
,
_
transform
);
}
}
void
updateSemanticsNode
({
@required
RenderObject
rendering
,
@required
SemanticsNode
semantics
,
...
...
@@ -595,9 +602,9 @@ class _SemanticsGeometry {
assert
(
semantics
!=
null
);
assert
(
parentSemantics
!=
null
);
assert
(
parentSemantics
.
wasAffectedByClip
!=
null
);
semantics
.
transform
=
transform
;
if
(
clipRect
!=
null
)
{
semantics
.
rect
=
clipRect
.
intersect
(
rendering
.
semanticBounds
);
semantics
.
transform
=
_
transform
;
if
(
_
clipRect
!=
null
)
{
semantics
.
rect
=
_
clipRect
.
intersect
(
rendering
.
semanticBounds
);
semantics
.
wasAffectedByClip
=
true
;
}
else
{
semantics
.
rect
=
rendering
.
semanticBounds
;
...
...
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