From 1f2543dd88397f14e899792e0cbeef88dd584d02 Mon Sep 17 00:00:00 2001 From: Michael Goderbauer Date: Fri, 21 Dec 2018 12:04:32 -0800 Subject: [PATCH 1/2] Add elevation and thickness to SemanticsNode --- lib/ui/semantics.dart | 6 ++++++ lib/ui/semantics/semantics_node.h | 2 ++ lib/ui/semantics/semantics_update_builder.cc | 4 ++++ lib/ui/semantics/semantics_update_builder.h | 2 ++ 4 files changed, 14 insertions(+) diff --git a/lib/ui/semantics.dart b/lib/ui/semantics.dart index 8ebce7de15abf..e64efe3c05d67 100644 --- a/lib/ui/semantics.dart +++ b/lib/ui/semantics.dart @@ -618,6 +618,8 @@ class SemanticsUpdateBuilder extends NativeFieldWrapperClass2 { double scrollPosition, double scrollExtentMax, double scrollExtentMin, + double elevation, + double thickness, Rect rect, String label, String hint, @@ -649,6 +651,8 @@ class SemanticsUpdateBuilder extends NativeFieldWrapperClass2 { rect.top, rect.right, rect.bottom, + elevation, + thickness, label, hint, value, @@ -676,6 +680,8 @@ class SemanticsUpdateBuilder extends NativeFieldWrapperClass2 { double top, double right, double bottom, + double elevation, + double thickness, String label, String hint, String value, diff --git a/lib/ui/semantics/semantics_node.h b/lib/ui/semantics/semantics_node.h index 4275cb7d83d30..7596dc20957e8 100644 --- a/lib/ui/semantics/semantics_node.h +++ b/lib/ui/semantics/semantics_node.h @@ -87,6 +87,8 @@ struct SemanticsNode { double scrollPosition = std::nan(""); double scrollExtentMax = std::nan(""); double scrollExtentMin = std::nan(""); + double elevation = 0.0; + double thickness = 0.0; std::string label; std::string hint; std::string value; diff --git a/lib/ui/semantics/semantics_update_builder.cc b/lib/ui/semantics/semantics_update_builder.cc index aca1fa7e32a42..575ba6e3227d0 100644 --- a/lib/ui/semantics/semantics_update_builder.cc +++ b/lib/ui/semantics/semantics_update_builder.cc @@ -50,6 +50,8 @@ void SemanticsUpdateBuilder::updateNode( double top, double right, double bottom, + double elevation, + double thickness, std::string label, std::string hint, std::string value, @@ -72,6 +74,8 @@ void SemanticsUpdateBuilder::updateNode( node.scrollExtentMax = scrollExtentMax; node.scrollExtentMin = scrollExtentMin; node.rect = SkRect::MakeLTRB(left, top, right, bottom); + node.elevation = elevation; + node.thickness = thickness; node.label = label; node.hint = hint; node.value = value; diff --git a/lib/ui/semantics/semantics_update_builder.h b/lib/ui/semantics/semantics_update_builder.h index ed486e260475c..ac8424d9f0fbd 100644 --- a/lib/ui/semantics/semantics_update_builder.h +++ b/lib/ui/semantics/semantics_update_builder.h @@ -38,6 +38,8 @@ class SemanticsUpdateBuilder double top, double right, double bottom, + double elevation, + double thickness, std::string label, std::string hint, std::string value, From 1e40d556fd14a8692b9389755380ff82cb0210b0 Mon Sep 17 00:00:00 2001 From: Michael Goderbauer Date: Fri, 21 Dec 2018 15:08:03 -0800 Subject: [PATCH 2/2] add doc --- lib/ui/semantics.dart | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/ui/semantics.dart b/lib/ui/semantics.dart index e64efe3c05d67..72576c613b7bc 100644 --- a/lib/ui/semantics.dart +++ b/lib/ui/semantics.dart @@ -607,6 +607,14 @@ class SemanticsUpdateBuilder extends NativeFieldWrapperClass2 { /// /// The `transform` is a matrix that maps this node's coordinate system into /// its parent's coordinate system. + /// + /// The `elevation` describes the distance in z-direction between this node + /// and the `elevation` of the parent. + /// + /// The `thickness` describes how much space this node occupies in the + /// z-direction starting at `elevation`. Basically, in the z-direction the + /// node starts at `elevation` above the parent and ends at `elevation` + + /// `thickness` above the parent. void updateNode({ int id, int flags,