myIsTransforming = false;
}
+//================================================================
+// Function : fitWidth
+// Purpose :
+//================================================================
+void GraphicsView_ViewPort::fitWidth()
+{
+ myIsTransforming = true;
+
+ double aGap = myFitAllGap;
+ QRectF aRect = objectsBoundingRect( true );
+
+ double aTop = aRect.top();
+ double aLeft = aRect.left();
+ double aMargin = 10;
+
+ aRect.setY( aRect.center().y() );
+ aRect.setHeight( aMargin );
+
+ fitInView( aRect.adjusted( -aGap, -aGap, aGap, aGap ), Qt::KeepAspectRatio );
+ ensureVisible( aLeft, aTop, aMargin, aMargin, 0, aGap );
+
+ myIsTransforming = false;
+}
+
//================================================================
// Function : currentBlock
// Purpose :
public:
enum TransformType { NoTransform, Reset, FitAll, FitRect, FitSelect,
- Zoom, PanGlobal, Pan, UserTransform = 100 };
+ Zoom, PanGlobal, Pan, FitWidth, UserTransform = 100 };
public:
GraphicsView_Viewer( const QString& title );
~GraphicsView_Viewer();