serializer: bypass bezier adj on keyframe type set

This commit is contained in:
itsmattkc
2022-06-10 09:55:56 -07:00
parent e74bb34d9a
commit 046b1cc498
3 changed files with 9 additions and 4 deletions
+7 -3
View File
@@ -99,7 +99,7 @@ const NodeKeyframe::Type &NodeKeyframe::type() const
void NodeKeyframe::set_type(const NodeKeyframe::Type &type)
{
if (type_ != type) {
type_ = type;
set_type_no_bezier_adj(type);
if (type_ == kBezier) {
// Set some sane defaults if this keyframe existed in the track and was just changed
@@ -120,11 +120,15 @@ void NodeKeyframe::set_type(const NodeKeyframe::Type &type)
}
}
}
emit TypeChanged(type_);
}
}
void NodeKeyframe::set_type_no_bezier_adj(const Type &type)
{
type_ = type;
emit TypeChanged(type_);
}
const QPointF &NodeKeyframe::bezier_control_in() const
{
return bezier_control_in_;
+1
View File
@@ -98,6 +98,7 @@ public:
*/
const Type& type() const;
void set_type(const Type& type);
void set_type_no_bezier_adj(const Type& type);
/**
* @brief For bezier interpolation, the control point leading into this keyframe
@@ -865,7 +865,7 @@ void ProjectSerializer220403::LoadKeyframe(QXmlStreamReader *reader, NodeKeyfram
} else if (attr.name() == QStringLiteral("time")) {
key->set_time(rational::fromString(attr.value().toString()));
} else if (attr.name() == QStringLiteral("type")) {
key->set_type(static_cast<NodeKeyframe::Type>(attr.value().toInt()));
key->set_type_no_bezier_adj(static_cast<NodeKeyframe::Type>(attr.value().toInt()));
} else if (attr.name() == QStringLiteral("inhandlex")) {
key_in_handle.setX(attr.value().toDouble());
} else if (attr.name() == QStringLiteral("inhandley")) {