From f9e9eaf8d442141502dfd1350036d7d935c136d8 Mon Sep 17 00:00:00 2001 From: koldo Date: Mon, 12 Nov 2018 10:08:56 +0000 Subject: [PATCH] ScatterDraw: Some adjustments git-svn-id: svn://ultimatepp.org/upp/trunk@12519 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- uppsrc/ScatterDraw/ScatterDraw.cpp | 4 ++-- uppsrc/ScatterDraw/ScatterDraw.h | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/uppsrc/ScatterDraw/ScatterDraw.cpp b/uppsrc/ScatterDraw/ScatterDraw.cpp index 97239ada3..041c76675 100644 --- a/uppsrc/ScatterDraw/ScatterDraw.cpp +++ b/uppsrc/ScatterDraw/ScatterDraw.cpp @@ -1317,10 +1317,10 @@ void ScatterDraw::DoZoom(double scale, bool mouseX, bool mouseY) { } xRange *= scale; double xmun = xRange/xMajorUnit; - if (xmun > 2*xMajorUnitNum) { + if (xmun > 1.2*xMajorUnitNum) { xMajorUnit *= 2; xMinUnit = xMinUnit0; - } else if (xmun < xMajorUnitNum/2) { + } else if (xmun < xMajorUnitNum/1.5) { xMajorUnit /= 2; xMinUnit = xMinUnit0; } diff --git a/uppsrc/ScatterDraw/ScatterDraw.h b/uppsrc/ScatterDraw/ScatterDraw.h index 48aa30323..df8c58611 100644 --- a/uppsrc/ScatterDraw/ScatterDraw.h +++ b/uppsrc/ScatterDraw/ScatterDraw.h @@ -1299,8 +1299,7 @@ bool ScatterDraw::PlotTexts(T& w, const bool boldX, bool boldY) Upp::Font fontY2Num = fontYNum; fontY2Num.Italic(); -debug_h(); - if (drawXReticle) + if (drawXReticle) for(int i = 0; xMinUnit + i*xMajorUnit <= xRange; i++) { double reticleX = plotW*xMinUnit/xRange + i*plotW/(xRange/xMajorUnit); double gridX = xMinUnit + i*xMajorUnit + xMin; @@ -1326,7 +1325,7 @@ debug_h(); fround(gridWidth*plotScaleAvg), axisColor); } } - + if (drawYReticle) for(int i = 0; yMinUnit + i*yMajorUnit <= yRange; i++) { int reticleY = fround(-plotH*yMinUnit/yRange + plotH - i*plotH/(yRange/yMajorUnit));