Explorar el Código

Fixup connection graphicswindow dimensions

Marcus Huderle hace 6 años
padre
commit
8df2a864a0
Se han modificado 2 ficheros con 2 adiciones y 2 borrados
  1. 0
    2
      editor.cpp
  2. 2
    0
      mainwindow.cpp

+ 0
- 2
editor.cpp Ver fichero

@@ -152,7 +152,6 @@ void Editor::showCurrentConnectionMap(QString curDirection) {
152 152
         connection_item->setY(y);
153 153
         connection_item->setZValue(21);
154 154
         scene->addItem(connection_item);
155
-        scene->setSceneRect(0, 0, pixmap.width() + map_item->pixmap().width(), pixmap.height() + map_item->pixmap().height());
156 155
 
157 156
         connect(connection_item, SIGNAL(connectionMoved(int)), this, SLOT(onConnectionOffsetChanged(int)));
158 157
         onConnectionOffsetChanged(connection->offset.toInt());
@@ -163,7 +162,6 @@ void Editor::showCurrentConnectionMap(QString curDirection) {
163 162
 
164 163
     if (!connectionExists) {
165 164
         if (connection_item) {
166
-            scene->removeItem(connection_item);
167 165
             delete connection_item;
168 166
             connection_item = NULL;
169 167
 

+ 2
- 0
mainwindow.cpp Ver fichero

@@ -154,6 +154,8 @@ void MainWindow::setMap(QString map_name) {
154 154
     ui->graphicsView_Objects_Map->editor = editor;
155 155
 
156 156
     ui->graphicsView_Connections->setScene(editor->scene);
157
+    ui->graphicsView_Connections->setSceneRect(editor->scene->sceneRect());
158
+    ui->graphicsView_Connections->setFixedSize(editor->scene->width() + 2, editor->scene->height() + 2);
157 159
 
158 160
     ui->graphicsView_Metatiles->setScene(editor->scene_metatiles);
159 161
     //ui->graphicsView_Metatiles->setSceneRect(editor->scene_metatiles->sceneRect());