X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-core%2Ftrunk%2Fsrc%2Fmodules%2Fexample%2Ffilledrect.cpp;h=f6f842f354539c2c0da25bb50ac0a70d054bf438;hb=284f2de6f33ed153630ffda94653a9eea093095e;hp=0c165edaf2daefd67d57d7261a7878d136984aaa;hpb=a5e308972adf0ac7c5953152527da961707bd6b5;p=synfig.git diff --git a/synfig-core/trunk/src/modules/example/filledrect.cpp b/synfig-core/trunk/src/modules/example/filledrect.cpp index 0c165ed..f6f842f 100644 --- a/synfig-core/trunk/src/modules/example/filledrect.cpp +++ b/synfig-core/trunk/src/modules/example/filledrect.cpp @@ -144,6 +144,26 @@ FilledRect::get_param_vocab()const return ret; } +synfig::Layer::Handle +FilledRect::hit_check(synfig::Context context, const synfig::Point &point)const +{ + Color clr; + Real amt; + + if (!get_color(point,clr,amt)) + return context.hit_check(point); + + synfig::Layer::Handle tmp; + + if (get_blend_method()==Color::BLEND_BEHIND && (tmp=context.hit_check(point))) + return tmp; + + if (Color::is_onto(get_blend_method()) && !(context.hit_check(point))) + return 0; + + return const_cast(this); +} + bool FilledRect::get_color(const Point &pos, Color &out, Real &outamount) const {