Browse Source

Fix offset value when selecting another connection

yenatch 6 years ago
parent
commit
ae4158ce7b
1 changed files with 2 additions and 1 deletions
  1. 2
    1
      editor.cpp

+ 2
- 1
editor.cpp View File

276
     setConnectionEditControlValues(selected_connection_item->connection);
276
     setConnectionEditControlValues(selected_connection_item->connection);
277
     ui->spinBox_ConnectionOffset->setMaximum(selected_connection_item->getMaxOffset());
277
     ui->spinBox_ConnectionOffset->setMaximum(selected_connection_item->getMaxOffset());
278
     ui->spinBox_ConnectionOffset->setMinimum(selected_connection_item->getMinOffset());
278
     ui->spinBox_ConnectionOffset->setMinimum(selected_connection_item->getMinOffset());
279
+    onConnectionOffsetChanged(selected_connection_item->connection->offset.toInt());
279
 }
280
 }
280
 
281
 
281
 void Editor::setSelectedConnectionFromMap(QString mapName) {
282
 void Editor::setSelectedConnectionFromMap(QString mapName) {
534
     selected_connection_item->connection->offset = QString::number(offset);
535
     selected_connection_item->connection->offset = QString::number(offset);
535
     if (selected_connection_item->connection->direction == "up" || selected_connection_item->connection->direction == "down") {
536
     if (selected_connection_item->connection->direction == "up" || selected_connection_item->connection->direction == "down") {
536
         selected_connection_item->setX(selected_connection_item->initialX + (offset - selected_connection_item->initialOffset) * 16);
537
         selected_connection_item->setX(selected_connection_item->initialX + (offset - selected_connection_item->initialOffset) * 16);
537
-    } else {
538
+    } else if (selected_connection_item->connection->direction == "left" || selected_connection_item->connection->direction == "right") {
538
         selected_connection_item->setY(selected_connection_item->initialY + (offset - selected_connection_item->initialOffset) * 16);
539
         selected_connection_item->setY(selected_connection_item->initialY + (offset - selected_connection_item->initialOffset) * 16);
539
     }
540
     }
540
     selected_connection_item->blockSignals(false);
541
     selected_connection_item->blockSignals(false);