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
 
@@ -1306,31 +1306,32 @@ void Main::ContIfRunning(void)
 
}
 

	
 
void Main::FitLeafToCanvas(void) 
 
{
 

	
 
  Vector ll,ur;
 
  mesh.BoundingBox(ll, ur);
 

	
 
  ll*=Cell::Magnification(); ur*=Cell::Magnification();
 

	
 
  // 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);
 
}
 

	
 
void Main::CleanMesh(void) 
 
{
 
  vector<double> clean_chem(Cell::NChem());
 
  vector<double> clean_transporters(Cell::NChem());
 

	
 
  for (int i=0;i<Cell::NChem();i++) {
 
    clean_chem[i]=par.initval[i];
 
    clean_transporters[i]=0.;		
 
  }
0 comments (0 inline, 0 general)