From: mkr Date: Thu, 10 May 2007 08:59:55 +0000 (+0000) Subject: Correct zoom volume. X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=refs%2Fheads%2FIOLS_SUPERV;p=modules%2Fgui.git Correct zoom volume. --- diff --git a/src/QxGraph/QxGraph_CanvasView.cxx b/src/QxGraph/QxGraph_CanvasView.cxx index a563bc5c2..4e0f848a8 100644 --- a/src/QxGraph/QxGraph_CanvasView.cxx +++ b/src/QxGraph/QxGraph_CanvasView.cxx @@ -235,11 +235,12 @@ void QxGraph_CanvasView::contentsMouseMoveEvent(QMouseEvent* theEvent) if ( myOperation == ZOOMVIEW ) { // Zoom + QWMatrix m = worldMatrix(); + double dx = aGlobalPoint.x() - myGlobalPoint.x(); - double s = 1. + fabs(dx)/10.; + double s = 1. + fabs(dx)*( (m.m11() < 1) ? m.m11() : 1. )/70.; if (dx < 0) s = 1./s; - QWMatrix m = worldMatrix(); m.scale(s, s); setWorldMatrix(m); diff --git a/src/QxGraph/QxGraph_Def.h b/src/QxGraph/QxGraph_Def.h index e8dc2487f..88937e325 100644 --- a/src/QxGraph/QxGraph_Def.h +++ b/src/QxGraph/QxGraph_Def.h @@ -26,8 +26,8 @@ #define DEF_BACK_COLOR QColor(144, 208, 211) #define RECTANGLE_BODY QColor(255,249,147) -#define GRAPH_WIDTH 1050 -#define GRAPH_HEIGHT 750 +#define GRAPH_WIDTH 1250 +#define GRAPH_HEIGHT 950 #define GRAPH_MARGIN 50