From b5ea786dbd925c529646a62ca885fe4f8b946658 Mon Sep 17 00:00:00 2001 From: Jim Van Verth Date: Fri, 16 Apr 2021 14:39:00 -0400 Subject: [PATCH] Viewer: apply same transform as slide to dimensions display. Change-Id: Ic5192b072c98617dee85f28f8f4214c7a805a1fd Reviewed-on: https://skia-review.googlesource.com/c/skia/+/397318 Reviewed-by: Mike Reed Commit-Queue: Jim Van Verth --- tools/viewer/Viewer.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/viewer/Viewer.cpp b/tools/viewer/Viewer.cpp index 6c433400b8..9a857211e4 100644 --- a/tools/viewer/Viewer.cpp +++ b/tools/viewer/Viewer.cpp @@ -1545,10 +1545,13 @@ void Viewer::drawSlide(SkSurface* surface) { } if (fShowSlideDimensions) { + SkCanvas* canvas = surface->getCanvas(); + SkAutoCanvasRestore acr(canvas, true); + canvas->concat(this->computeMatrix()); SkRect r = SkRect::Make(fSlides[fCurrentSlide]->getDimensions()); SkPaint paint; paint.setColor(0x40FFFF00); - surface->getCanvas()->drawRect(r, paint); + canvas->drawRect(r, paint); } }