New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix!: for some layers hit_check() missed some blend method influence #2754
Conversation
Example: Layer_Bitmap and Layer_SolidColor ignored BLEND_BEHIND completely. Gradient layers need some investigation (Conical, Curve, Linear, Radial, Spiral, Noise). They behave differently, also checking the alpha channel for some blend methods. BREAKING CHANGE: synfig API changed: - add `Layer_Composite::basic_hit_check()` as a helper
I just found out Layer_PasteCanvas has issues too. |
Does it affect rendering? |
No, |
Ok. |
Coming back to the gradient layers, here are current code of each one, preceded by the commit id and date.
Most of them use this part: if((get_blend_method()==Color::BLEND_STRAIGHT || get_blend_method()==Color::BLEND_COMPOSITE) && color_func(point).get_a()>0.5)
return const_cast<ConicalGradient*>(this);
if(color_func(point,0,context).get_a()>0.5)
return const_cast<Noise*>(this); Finally, for comparison, this is the equivalent part for other layers (after this PR): Layer::Handle tmp;
// if we are behind the context, and the click hits something in the context
if (get_blend_method() == Color::BLEND_BEHIND && (tmp = context.hit_check(point)))
// then return the thing it hit in the context
return tmp;
// if we're using an 'onto' blend method and the click missed the context
if (Color::is_onto(get_blend_method()) && !(tmp = context.hit_check(point)))
// then it misses everything
return nullptr; So, what should we do? @morevnaproject @ice0 @anyone Complete
|
Do you mean to fix them so they don't ignore the blend method? |
Yes. And they bring the |
Example:
Layer_Bitmap and Layer_SolidColor ignored BLEND_BEHIND completely.
Gradient layers need some investigation
(Conical, Curve, Linear, Radial, Spiral, Noise).
They behave differently, also checking the alpha channel for some blend
methods.
BREAKING CHANGE: synfig API changed:
Layer_Composite::basic_hit_check()
as a helper