From 8df2a864a0504a89bbc7f6ebf92e05215babadcb Mon Sep 17 00:00:00 2001 From: Marcus Huderle Date: Thu, 8 Mar 2018 22:35:16 -0800 Subject: [PATCH] Fixup connection graphicswindow dimensions --- editor.cpp | 2 -- mainwindow.cpp | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/editor.cpp b/editor.cpp index eb67f471..75b665b1 100755 --- a/editor.cpp +++ b/editor.cpp @@ -152,7 +152,6 @@ void Editor::showCurrentConnectionMap(QString curDirection) { connection_item->setY(y); connection_item->setZValue(21); scene->addItem(connection_item); - scene->setSceneRect(0, 0, pixmap.width() + map_item->pixmap().width(), pixmap.height() + map_item->pixmap().height()); connect(connection_item, SIGNAL(connectionMoved(int)), this, SLOT(onConnectionOffsetChanged(int))); onConnectionOffsetChanged(connection->offset.toInt()); @@ -163,7 +162,6 @@ void Editor::showCurrentConnectionMap(QString curDirection) { if (!connectionExists) { if (connection_item) { - scene->removeItem(connection_item); delete connection_item; connection_item = NULL; diff --git a/mainwindow.cpp b/mainwindow.cpp index 0ac38cba..0cc057af 100755 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -154,6 +154,8 @@ void MainWindow::setMap(QString map_name) { ui->graphicsView_Objects_Map->editor = editor; ui->graphicsView_Connections->setScene(editor->scene); + ui->graphicsView_Connections->setSceneRect(editor->scene->sceneRect()); + ui->graphicsView_Connections->setFixedSize(editor->scene->width() + 2, editor->scene->height() + 2); ui->graphicsView_Metatiles->setScene(editor->scene_metatiles); //ui->graphicsView_Metatiles->setSceneRect(editor->scene_metatiles->sceneRect());