From f6cbf4b25555421ae81857457e4773ad5614e9c9 Mon Sep 17 00:00:00 2001 From: mkr Date: Thu, 10 May 2007 08:59:55 +0000 Subject: [PATCH] Correct zoom volume. --- src/QxGraph/QxGraph_CanvasView.cxx | 5 +++-- src/QxGraph/QxGraph_Def.h | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) 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 -- 2.39.2