Skip to content

Commit 6c68bf3

Browse files
authored
Revert "Revert "Add elevation and thickness to SemanticsNode (flutter#7282)" (flutter#7483)" (flutter#7484)
This reverts commit 24cf93e.
1 parent fdfb0e7 commit 6c68bf3

4 files changed

Lines changed: 22 additions & 0 deletions

File tree

lib/ui/semantics.dart

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -607,6 +607,14 @@ class SemanticsUpdateBuilder extends NativeFieldWrapperClass2 {
607607
///
608608
/// The `transform` is a matrix that maps this node's coordinate system into
609609
/// its parent's coordinate system.
610+
///
611+
/// The `elevation` describes the distance in z-direction between this node
612+
/// and the `elevation` of the parent.
613+
///
614+
/// The `thickness` describes how much space this node occupies in the
615+
/// z-direction starting at `elevation`. Basically, in the z-direction the
616+
/// node starts at `elevation` above the parent and ends at `elevation` +
617+
/// `thickness` above the parent.
610618
void updateNode({
611619
int id,
612620
int flags,
@@ -618,6 +626,8 @@ class SemanticsUpdateBuilder extends NativeFieldWrapperClass2 {
618626
double scrollPosition,
619627
double scrollExtentMax,
620628
double scrollExtentMin,
629+
double elevation,
630+
double thickness,
621631
Rect rect,
622632
String label,
623633
String hint,
@@ -647,6 +657,8 @@ class SemanticsUpdateBuilder extends NativeFieldWrapperClass2 {
647657
rect.top,
648658
rect.right,
649659
rect.bottom,
660+
elevation,
661+
thickness,
650662
label,
651663
hint,
652664
value,
@@ -674,6 +686,8 @@ class SemanticsUpdateBuilder extends NativeFieldWrapperClass2 {
674686
double top,
675687
double right,
676688
double bottom,
689+
double elevation,
690+
double thickness,
677691
String label,
678692
String hint,
679693
String value,

lib/ui/semantics/semantics_node.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,8 @@ struct SemanticsNode {
8787
double scrollPosition = std::nan("");
8888
double scrollExtentMax = std::nan("");
8989
double scrollExtentMin = std::nan("");
90+
double elevation = 0.0;
91+
double thickness = 0.0;
9092
std::string label;
9193
std::string hint;
9294
std::string value;

lib/ui/semantics/semantics_update_builder.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ void SemanticsUpdateBuilder::updateNode(
5050
double top,
5151
double right,
5252
double bottom,
53+
double elevation,
54+
double thickness,
5355
std::string label,
5456
std::string hint,
5557
std::string value,
@@ -72,6 +74,8 @@ void SemanticsUpdateBuilder::updateNode(
7274
node.scrollExtentMax = scrollExtentMax;
7375
node.scrollExtentMin = scrollExtentMin;
7476
node.rect = SkRect::MakeLTRB(left, top, right, bottom);
77+
node.elevation = elevation;
78+
node.thickness = thickness;
7579
node.label = label;
7680
node.hint = hint;
7781
node.value = value;

lib/ui/semantics/semantics_update_builder.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ class SemanticsUpdateBuilder
3838
double top,
3939
double right,
4040
double bottom,
41+
double elevation,
42+
double thickness,
4143
std::string label,
4244
std::string hint,
4345
std::string value,

0 commit comments

Comments
 (0)