diff --git a/src/gui/interact/ui-coord-resolver.hpp b/src/gui/interact/ui-coord-resolver.hpp index 6c1ae1ffb..05e6cb583 100644 --- a/src/gui/interact/ui-coord-resolver.hpp +++ b/src/gui/interact/ui-coord-resolver.hpp @@ -347,7 +347,10 @@ namespace interact { anchor() { if (canAnchor()) - window (res_.anchor); + { + window (res_.anchor); + normalise(); + } return std::move (*this); } diff --git a/src/gui/interact/ui-coord.hpp b/src/gui/interact/ui-coord.hpp index 76dbc5d1c..c1be9e7ae 100644 --- a/src/gui/interact/ui-coord.hpp +++ b/src/gui/interact/ui-coord.hpp @@ -591,6 +591,14 @@ namespace interact { uic_.truncateTo (depth); return std::move (*this); } + + protected: + Builder&& + normalise() + { + uic_.normalise(); + return std::move (*this); + } }; diff --git a/tests/gui/interact/ui-coord-resolver-test.cpp b/tests/gui/interact/ui-coord-resolver-test.cpp index a2fb925d9..1d71923ca 100644 --- a/tests/gui/interact/ui-coord-resolver-test.cpp +++ b/tests/gui/interact/ui-coord-resolver-test.cpp @@ -497,6 +497,12 @@ namespace test { * This operation changes only the window part of the coordinate spec; * it might use the result of a preceding coverage solution search or even * trigger such a search, but only to find out about the root window. + * @note some fine points touched here: to anchor a path is something + * different than to cover it; in fact there are cases where we + * can determine the possible anchor point, but are unable to + * cover the path spec beyond that. And, on the other hand, + * there are cases where you _need to compute a coverage_ + * in order to decide upon the anchor point. */ void verify_mutateAnchor() @@ -563,12 +569,13 @@ namespace test { /* === coverage solution is calculated on demand === */ UICoordResolver r4 {UICoord().view("thirdView").append("#2/sub"), tree}; + CHECK ("UI:?.thirdView.#2/sub" == string(r4)); CHECK (not r4.isAnchored()); CHECK (0 == r4.coverDepth()); r4.anchor(); CHECK (1 == r4.coverDepth()); CHECK (r4.isCoveredPartially()); - cout << r4 < - - + + @@ -9267,21 +9267,42 @@ - - - - - - + + + + + + - - + + + + + + + + + + + +

+ das ist immer schon korrekt erledigt +

+ + +
+ + + - - - - + + + + + + + @@ -9321,8 +9342,8 @@ - - + +