Salome HOME
Bug fix: don't set "Loading" state for MacroNodes in InitialState() function (called...
[modules/superv.git] / src / SUPERVGUI / SUPERVGUI_CanvasLink.cxx
index 4ed27d15d741bcbf2d62166426ce14cf7768a114..74b6b762b769fd65dfb1bf8a7d8466a76c5a820c 100644 (file)
@@ -522,6 +522,12 @@ void SUPERVGUI_CanvasPointPrs::moveBy(double dx, double dy)
   QCanvasEllipse::moveBy(dx, dy);
   if (myInEdge) myInEdge->setFromPoint((int)x(), (int)y());
   if (myOutEdge) myOutEdge->setToPoint((int)x(), (int)y());
+  //resize canvas view if mouse is outside
+  int w = (int)(x()+dx) + width() + GRAPH_MARGIN;
+  int h = (int)(y()+dy) + height() + GRAPH_MARGIN;
+  if (canvas()->width() > w) w = canvas()->width();
+  if (canvas()->height() > h) h = canvas()->height();
+  if (canvas()->width() < w || canvas()->height() < h) canvas()->resize(w, h);
   if (myIndex > 0 && isMoving()) {
     myLink->getEngine()->ChangeCoord(myIndex, (int)x(), (int)y());
   }