Summary: | equations are incorrectly re-sampled | ||
---|---|---|---|
Product: | [Applications] kst | Reporter: | Netterfield <netterfield> |
Component: | general | Assignee: | kst |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | NOR | ||
Version: | 1.x | ||
Target Milestone: | --- | ||
Platform: | unspecified | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: |
Description
Netterfield
2004-08-14 03:23:04 UTC
The patch I submitted earlier fixes the case where NS_i == int(a)NS_j. But this is rarely the case. More often, for RVectors NS_i = int(a)(NS_j-SPF) + 1 So that the 1st and last samples correspond properly. Fixing it will be non-trival, but I think it is pretty important. Thoughts? CVS commit by netterfield: fix for [Bug 87177] equations are incorrectly re-sampled CCMAIL: 87177-done@bugs.kde.org M +5 -10 kstequationcurve.cpp 1.61.2.1 --- kdeextragear-2/kst/kst/kstequationcurve.cpp #1.61:1.61.2.1 @@ -371,16 +371,11 @@ bool KstEquationCurve::FillY(bool force) } } - if ((*_xVector)->sampleCount() > 0) { - _interp = (ns+1) / (*_xVector)->sampleCount(); - } else { // avoid divide by zero - _interp = 1; - } } else { - _interp = 1; + ns = (*_xVector)->sampleCount(); } - if (NS != (*_xVector)->sampleCount() || _interp != 1 || + if (NS != (*_xVector)->sampleCount() || (ns != (*_xVector)->sampleCount()) || (*_xVector)->numShift() != (*_xVector)->numNew()) { - NS = (*_xVector)->sampleCount()*_interp;// - 1; + NS = ns; KstVectorPtr yv = *_yVector; @@ -395,6 +390,6 @@ bool KstEquationCurve::FillY(bool force) // calculate shift and new samples // only do shift optimization if all used vectors are same size and shift - v_shift = (*_xVector)->numShift()*_interp; - v_new = (*_xVector)->numNew()*_interp; + v_shift = (*_xVector)->numShift(); + v_new = (*_xVector)->numNew(); for (i_v = 0; i_v < VectorsUsed.count(); i_v++) { |