implemented saving bezier handles and fixed selection crash

This commit is contained in:
itsmattkc
2019-01-04 22:45:08 +11:00
parent fc7c17dee9
commit 4aa44f8fa6
2 changed files with 13 additions and 1 deletions
+12
View File
@@ -701,6 +701,14 @@ void Effect::load(QXmlStreamReader& stream) {
key.time = attr.value().toLong();
} else if (attr.name() == "type") {
key.type = attr.value().toInt();
} else if (attr.name() == "prehx") {
key.pre_handle_x = attr.value().toDouble();
} else if (attr.name() == "prehy") {
key.pre_handle_y = attr.value().toDouble();
} else if (attr.name() == "posthx") {
key.post_handle_x = attr.value().toDouble();
} else if (attr.name() == "posthy") {
key.post_handle_y = attr.value().toDouble();
}
}
field->keyframes.append(key);
@@ -740,6 +748,10 @@ void Effect::save(QXmlStreamWriter& stream) {
stream.writeAttribute("value", save_data_to_string(field->type, key.data));
stream.writeAttribute("frame", QString::number(key.time));
stream.writeAttribute("type", QString::number(key.type));
stream.writeAttribute("prehx", QString::number(key.pre_handle_x));
stream.writeAttribute("prehy", QString::number(key.pre_handle_y));
stream.writeAttribute("posthx", QString::number(key.post_handle_x));
stream.writeAttribute("posthy", QString::number(key.post_handle_y));
stream.writeEndElement(); // key
}
stream.writeEndElement(); // field
+1 -1
View File
@@ -392,7 +392,7 @@ void GraphView::mousePressEvent(QMouseEvent *event) {
if (sel_key > -1) {
for (int i=0;i<selected_keys.size();i++) {
if (selected_keys.at(i) == sel_key && selected_keys_fields.at(i) == sel_key_field) {
if ((event->modifiers() & Qt::ShiftModifier)) {
if ((event->modifiers() & Qt::ShiftModifier) && current_handle == BEZIER_HANDLE_NONE) {
selected_keys.removeAt(i);
selected_keys_fields.removeAt(i);
}