From 2bb6c597f8bdf0d3348538576b0203397ea488fa Mon Sep 17 00:00:00 2001 From: koldo Date: Wed, 4 Sep 2019 14:13:55 +0000 Subject: [PATCH] *ScatterDraw: Fixed bug in VectorVectorY git-svn-id: svn://ultimatepp.org/upp/trunk@13576 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- uppsrc/ScatterDraw/DataSource.cpp | 22 +++++++++++----------- uppsrc/ScatterDraw/DataSource.h | 8 ++++---- uppsrc/ScatterDraw/ScatterDraw.h | 8 ++++---- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/uppsrc/ScatterDraw/DataSource.cpp b/uppsrc/ScatterDraw/DataSource.cpp index eb773d292..26763dcb7 100644 --- a/uppsrc/ScatterDraw/DataSource.cpp +++ b/uppsrc/ScatterDraw/DataSource.cpp @@ -697,21 +697,21 @@ bool DataSource::SameX(DataSource &data) { return true; } -void ExplicitData::Init(Function funz, double minX, double maxX, double minY, double maxY) { +void ExplicitData::Init(Function _funz, double _minX, double _maxX, double _minY, double _maxY) { ASSERT(maxX >= minX && maxY >= minY); - this->funz = funz; - this->minX = minX; - this->maxX = maxX; - this->minY = minY; - this->maxY = maxY; + this->funz = _funz; + this->minX = _minX; + this->maxX = _maxX; + this->minY = _minY; + this->maxY = _maxY; minZ = -DOUBLE_NULL_LIM; maxZ = DOUBLE_NULL_LIM; - double deltax = (maxX - minX)/100.; - double deltay = (maxY - minY)/100.; - for (double x = minX; x <= maxX; x += deltax) { - for (double y = minY; y <= maxY; y += deltay) { - double z = funz(x, y); + double deltax = (_maxX - _minX)/100.; + double deltay = (_maxY - _minY)/100.; + for (double x = _minX; x <= _maxX; x += deltax) { + for (double y = _minY; y <= _maxY; y += deltay) { + double z = _funz(x, y); if (!IsNull(z)) { minZ = min(minZ, z); maxZ = max(maxZ, z); diff --git a/uppsrc/ScatterDraw/DataSource.h b/uppsrc/ScatterDraw/DataSource.h index 5ca2111bb..3bdcf9af1 100644 --- a/uppsrc/ScatterDraw/DataSource.h +++ b/uppsrc/ScatterDraw/DataSource.h @@ -409,14 +409,14 @@ public: this->idsFixed = clone(_idsFixed); this->beginData = _beginData; this->numData = _numData; - if (IsNull(numData)) { - if (!useRows) { + if (IsNull(_numData)) { + if (!_useRows) { if (_data.IsEmpty()) this->numData = 0; else - this->numData = data[0].GetCount() - beginData; + this->numData = _data[0].GetCount() - _beginData; } else - this->numData = _data.GetCount() - beginData; + this->numData = _data.GetCount() - _beginData; } } void Init(Vector > &_data, int _idx, int _idy, bool _useRows = true, int _beginData = 0, int _numData = Null) { diff --git a/uppsrc/ScatterDraw/ScatterDraw.h b/uppsrc/ScatterDraw/ScatterDraw.h index 68bcc6a86..1638cf901 100644 --- a/uppsrc/ScatterDraw/ScatterDraw.h +++ b/uppsrc/ScatterDraw/ScatterDraw.h @@ -338,9 +338,9 @@ public: ScatterDraw& Responsive(bool _responsive = true, double factor = 1) { this->responsive = _responsive; responsivenessFactor = factor; - plotScaleX = responsive ? responsivenessFactor*size.cx/600. : 1; - plotScaleY = responsive ? responsivenessFactor*size.cy/400. : 1; - plotScaleAvg = responsive ? (plotScaleX + plotScaleY)/2. : 1; + plotScaleX = _responsive ? responsivenessFactor*size.cx/600. : 1; + plotScaleY = _responsive ? responsivenessFactor*size.cy/400. : 1; + plotScaleAvg = _responsive ? (plotScaleX + plotScaleY)/2. : 1; return *this; } bool IsResponsive() {return responsive;} @@ -421,7 +421,7 @@ public: Color& GetLegendFillColor() {return legendFillColor;} Color& GetLegendBorderColor() {return legendBorderColor;} - ScatterDraw& SetMode(int _mode = MD_ANTIALIASED) {this->mode = _mode; Refresh(); return *this;}; + ScatterDraw& SetMode(int _mode = MD_ANTIALIASED) {this->mode = _mode; Refresh(); return *this;}; int GetMode() {return mode;}; void ZoomToFit(bool horizontal = true, bool vertical = false, double factor = 0);