Add XY to zoom window

Bug: skia:7332
Change-Id: I3a7d5cf20c75bb288d5aa0fa9046e77a669aad64
Reviewed-on: https://skia-review.googlesource.com/74560
Reviewed-by: Yuqian Li <liyuqian@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
This commit is contained in:
Brian Osman 2017-11-21 14:59:31 -05:00 committed by Skia Commit-Bot
parent bff5a98cdf
commit 07b56b2f38

View File

@ -1343,7 +1343,9 @@ void Viewer::drawImGui(SkCanvas* canvas) {
SkImageInfo info = SkImageInfo::MakeN32Premul(1, 1);
if (fLastImage->readPixels(info, &pixel, info.minRowBytes(), mousePos.x, mousePos.y)) {
ImGui::SameLine();
ImGui::Text("RGBA: %x %x %x %x", SkGetPackedR32(pixel), SkGetPackedG32(pixel),
ImGui::Text("(X, Y): %d, %d RGBA: %x %x %x %x",
sk_float_round2int(mousePos.x), sk_float_round2int(mousePos.y),
SkGetPackedR32(pixel), SkGetPackedG32(pixel),
SkGetPackedB32(pixel), SkGetPackedA32(pixel));
}