examples: polished for a sleek initial screen appearance

This commit is contained in:
Hermet Park 2025-03-06 19:07:38 +09:00
parent 9e6a514022
commit 97b48a97c1
2 changed files with 5 additions and 0 deletions

View file

@ -39,6 +39,8 @@ struct UserExample : tvgexam::Example
if (!tvgexam::verify(picture->load(EXAMPLE_DIR"/image/scale.jpg"))) return false; if (!tvgexam::verify(picture->load(EXAMPLE_DIR"/image/scale.jpg"))) return false;
picture->scale(1.5f);
canvas->push(picture); canvas->push(picture);
return true; return true;

View file

@ -36,6 +36,9 @@ struct UserExample : tvgexam::Example
{ {
if (!canvas) return false; 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(); auto mask = tvg::Shape::gen();
mask->appendCircle(w/2, h/2, w/2, h/2); mask->appendCircle(w/2, h/2, w/2, h/2);
mask->fill(255, 255, 255); mask->fill(255, 255, 255);