Repository navigation
Conversation
|
This PR addresses issue #3582 by adding support for the The PR is currently awaiting workflow approval and reviewer feedback. Kindly let me know if any changes are needed, or if anything else is required from my side to proceed. Thanks in advance! |
|
|
||
| Real link = (*link_) (t).get(Real()); | ||
| ValueBase input_value = (*link_)(t); | ||
| Real link = 0; |
rodolforg
left a comment
There was a problem hiding this comment.
Were you able to build synfig once?
| switch (input_value.get_type()) | ||
| { | ||
| case ValueBase::TYPE_REAL: |
There was a problem hiding this comment.
It won't work. ValueBase::get_type() doesn't return an enumeration.
Please check other valuenode implementations to see how it should be done.
| link = input_value.get(Real()); | ||
| break; | ||
| case ValueBase::TYPE_ANGLE: | ||
| link = input_value.get(Angle()); // Angle → Real |
There was a problem hiding this comment.
The conversion shouldn't be done this way.
You should use an Angle value in an Angle::rad() or Angle:degree() first, and then use .get() to make it a Real value number.
example:
Real real_value = Angle::rad(my_angle_var).get();| synfig::warning("ValueNode_Logarithm: Unsupported type for input: %d", input_value.get_type()); | ||
| return 0.0; |
There was a problem hiding this comment.
Please check other valuenodes to see how we handle bad type cases.
| * \brief Computes the natural logarithm (ln) of the input. | ||
| * | ||
| * Accepts input of type Real or Angle. | ||
| * If input is Angle, it is converted to radians before applying log(). |
There was a problem hiding this comment.
@morevnaproject , should it be parsed as radian or degree first?
|
Thank you for attempting to improve your contribution description! ✨ New Features
|
|
I am closing this. |
This PR adds support for the
Angletype in the Logarithm converter (ValueNode_Logarithm). Previously, the converter only acceptedRealvalues. With this update, it can now also acceptAngleinputs, which are internally converted to radians (asReal) before applying the logarithmic operation.Changes Made
operator()to handleValueBase::TYPE_ANGLEsafely.check_type()to accept bothtype_realandtype_angle.valuenode_log.hto reflect the new support forAngle.