From ece153727161fdb8d25775870f674241028cc3da Mon Sep 17 00:00:00 2001 From: Hermet Park Date: Fri, 16 Aug 2024 15:21:11 +0900 Subject: [PATCH] examples: replaced ClipPath with clip() --- examples/{ClipPath.cpp => Clipping.cpp} | 10 +++++----- examples/PictureRaw.cpp | 2 +- examples/TvgSaver.cpp | 2 +- examples/meson.build | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) rename examples/{ClipPath.cpp => Clipping.cpp} (93%) diff --git a/examples/ClipPath.cpp b/examples/Clipping.cpp similarity index 93% rename from examples/ClipPath.cpp rename to examples/Clipping.cpp index cd2e6aa1..4ffacba5 100644 --- a/examples/ClipPath.cpp +++ b/examples/Clipping.cpp @@ -70,7 +70,7 @@ struct UserExample : tvgexam::Example clipStar->appendCircle(200, 230, 110, 110); clipStar->translate(10, 10); - star1->composite(std::move(clipStar), tvg::CompositeMethod::ClipPath); + star1->clip(std::move(clipStar)); auto star2 = tvg::Shape::gen(); compose(star2.get()); @@ -91,7 +91,7 @@ struct UserExample : tvgexam::Example scene->push(std::move(star2)); //Clipping scene to shape - scene->composite(std::move(clip), tvg::CompositeMethod::ClipPath); + scene->clip(std::move(clip)); canvas->push(std::move(scene)); @@ -118,7 +118,7 @@ struct UserExample : tvgexam::Example clipRect->translate(20, 20); //Clipping scene to rect(shape) - star3->composite(std::move(clipRect), tvg::CompositeMethod::ClipPath); + star3->clip(std::move(clipRect)); canvas->push(std::move(star3)); @@ -136,7 +136,7 @@ struct UserExample : tvgexam::Example clipPath->translate(20, 20); //Clipping picture to path - picture->composite(std::move(clipPath), tvg::CompositeMethod::ClipPath); + picture->clip(std::move(clipPath)); canvas->push(std::move(picture)); @@ -150,7 +150,7 @@ struct UserExample : tvgexam::Example clipShape->appendRect(600, 420, 100, 100); //Clipping shape1 to clipShape - shape1->composite(std::move(clipShape), tvg::CompositeMethod::ClipPath); + shape1->clip(std::move(clipShape)); canvas->push(std::move(shape1)); diff --git a/examples/PictureRaw.cpp b/examples/PictureRaw.cpp index 53ec769b..e8bc0b3f 100644 --- a/examples/PictureRaw.cpp +++ b/examples/PictureRaw.cpp @@ -62,7 +62,7 @@ struct UserExample : tvgexam::Example auto circle = tvg::Shape::gen(); circle->appendCircle(350, 350, 200, 200); - picture2->composite(std::move(circle), tvg::CompositeMethod::ClipPath); + picture2->clip(std::move(circle)); canvas->push(std::move(picture2)); diff --git a/examples/TvgSaver.cpp b/examples/TvgSaver.cpp index 94b767fa..5c6695b0 100644 --- a/examples/TvgSaver.cpp +++ b/examples/TvgSaver.cpp @@ -38,7 +38,7 @@ unique_ptr tvgClippedImage(uint32_t * data, int width, int height) auto imageClip = tvg::Shape::gen(); imageClip->appendCircle(400, 200, 80, 180); imageClip->translate(200, 0); - image->composite(std::move(imageClip), tvg::CompositeMethod::ClipPath); + image->clip(std::move(imageClip)); return image; } diff --git a/examples/meson.build b/examples/meson.build index aeb8ff64..db88c18a 100644 --- a/examples/meson.build +++ b/examples/meson.build @@ -22,7 +22,7 @@ source_file = [ 'AnimateMasking.cpp', 'Animation.cpp', 'Blending.cpp', - 'ClipPath.cpp', + 'Clipping.cpp', 'CustomTransform.cpp', 'DataLoad.cpp', 'DirectUpdate.cpp',