Changeset - 931f70c7449d
[Not reviewed]
default
0 1 0
Roeland Merks - 15 years ago 2010-11-29 13:55:37
roeland.merks@cwi.nl
Fixed 'flashy' bug; scene keeps on flashing up and down after switching models. We needed to reset the SceneRect of QGraphicsView after reading a new model.

--
user: Roeland Merks <roeland.merks@cwi.nl>
branch 'default'
changed src/canvas.cpp
1 file changed with 2 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/canvas.cpp
Show inline comments
 
@@ -1315,13 +1315,14 @@ void Main::FitLeafToCanvas(void)
 

	
 
  // give the leaf some space
 
  Vector border = ((ur-ll)/5.);
 

	
 
  
 
  QRectF bb( ll.x - border.x, ll.y - border.y, ur.x-ll.x + 2*border.x, ur.y-ll.y + 2*border.y );
 

	
 

	
 
  // cerr << ur << ", " << ll << endl;
 
  // editor->fitInView(bb, Qt::KeepAspectRatio);
 
  editor->ensureVisible(bb);
 
  canvas.setSceneRect(bb);
 
  //editor->setTransform(viewport);
 
}
 

	
0 comments (0 inline, 0 general)