From 97b48a97c18eeaf2d16727785e7c367d1eebe086 Mon Sep 17 00:00:00 2001 From: Hermet Park Date: Thu, 6 Mar 2025 19:07:38 +0900 Subject: [PATCH] examples: polished for a sleek initial screen appearance --- examples/ImageScaling.cpp | 2 ++ examples/Viewport.cpp | 3 +++ 2 files changed, 5 insertions(+) diff --git a/examples/ImageScaling.cpp b/examples/ImageScaling.cpp index 7f9cb77d..635daea9 100644 --- a/examples/ImageScaling.cpp +++ b/examples/ImageScaling.cpp @@ -39,6 +39,8 @@ struct UserExample : tvgexam::Example if (!tvgexam::verify(picture->load(EXAMPLE_DIR"/image/scale.jpg"))) return false; + picture->scale(1.5f); + canvas->push(picture); return true; diff --git a/examples/Viewport.cpp b/examples/Viewport.cpp index 840a915d..9af0b7e9 100644 --- a/examples/Viewport.cpp +++ b/examples/Viewport.cpp @@ -36,6 +36,9 @@ struct UserExample : tvgexam::Example { if (!canvas) return false; + //set viewport before canvas become dirty. + if (!tvgexam::verify(canvas->viewport(0, 0, VPORT_SIZE, VPORT_SIZE))) return false; + auto mask = tvg::Shape::gen(); mask->appendCircle(w/2, h/2, w/2, h/2); mask->fill(255, 255, 255);