[sksg] Fix group hit-testing order

Change-Id: Idc25109a598caabf01e3ab61dc97f984ff453d40
Reviewed-on: https://skia-review.googlesource.com/c/191664
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Florin Malita <fmalita@chromium.org>
Reviewed-by: Mike Reed <reed@google.com>
This commit is contained in:
Florin Malita 2019-02-12 15:41:39 -05:00 committed by Skia Commit-Bot
parent be89130dbf
commit 63136afbd0
2 changed files with 4 additions and 4 deletions

View File

@ -67,8 +67,8 @@ void Group::onRender(SkCanvas* canvas, const RenderContext* ctx) const {
}
const RenderNode* Group::onNodeAt(const SkPoint& p) const {
for (const auto& child : fChildren) {
if (const auto* node = child->nodeAt(p)) {
for (auto it = fChildren.crbegin(); it != fChildren.crend(); ++it) {
if (const auto* node = (*it)->nodeAt(p)) {
return node;
}
}

View File

@ -98,8 +98,8 @@ static void inval_test1(skiatest::Reporter* reporter) {
{{ 0, -1 }, nullptr },
{{ 100, 0 }, nullptr },
{{ 0, 100 }, nullptr },
{{ 0, 0 }, d1 },
{{ 99, 99 }, d1 },
{{ 0, 0 }, d2 },
{{ 99, 99 }, d2 },
});
}