examples: replaced ClipPath with clip()

This commit is contained in:
Hermet Park 2024-08-16 15:21:11 +09:00 committed by Hermet Park
parent b0683a26ec
commit ece1537271
4 changed files with 8 additions and 8 deletions

View file

@ -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));

View file

@ -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));

View file

@ -38,7 +38,7 @@ unique_ptr<tvg::Paint> 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;
}

View file

@ -22,7 +22,7 @@ source_file = [
'AnimateMasking.cpp',
'Animation.cpp',
'Blending.cpp',
'ClipPath.cpp',
'Clipping.cpp',
'CustomTransform.cpp',
'DataLoad.cpp',
'DirectUpdate.cpp',