Browse Source

Fixup connection graphicswindow dimensions

Marcus Huderle 6 years ago
parent
commit
8df2a864a0
2 changed files with 2 additions and 2 deletions
  1. 0
    2
      editor.cpp
  2. 2
    0
      mainwindow.cpp

+ 0
- 2
editor.cpp View File

152
         connection_item->setY(y);
152
         connection_item->setY(y);
153
         connection_item->setZValue(21);
153
         connection_item->setZValue(21);
154
         scene->addItem(connection_item);
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
         connect(connection_item, SIGNAL(connectionMoved(int)), this, SLOT(onConnectionOffsetChanged(int)));
156
         connect(connection_item, SIGNAL(connectionMoved(int)), this, SLOT(onConnectionOffsetChanged(int)));
158
         onConnectionOffsetChanged(connection->offset.toInt());
157
         onConnectionOffsetChanged(connection->offset.toInt());
163
 
162
 
164
     if (!connectionExists) {
163
     if (!connectionExists) {
165
         if (connection_item) {
164
         if (connection_item) {
166
-            scene->removeItem(connection_item);
167
             delete connection_item;
165
             delete connection_item;
168
             connection_item = NULL;
166
             connection_item = NULL;
169
 
167
 

+ 2
- 0
mainwindow.cpp View File

154
     ui->graphicsView_Objects_Map->editor = editor;
154
     ui->graphicsView_Objects_Map->editor = editor;
155
 
155
 
156
     ui->graphicsView_Connections->setScene(editor->scene);
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
     ui->graphicsView_Metatiles->setScene(editor->scene_metatiles);
160
     ui->graphicsView_Metatiles->setScene(editor->scene_metatiles);
159
     //ui->graphicsView_Metatiles->setSceneRect(editor->scene_metatiles->sceneRect());
161
     //ui->graphicsView_Metatiles->setSceneRect(editor->scene_metatiles->sceneRect());