Commit 718f5f71 authored by thomas.forbriger's avatar thomas.forbriger
Browse files

ts/stuploxx [FIX]: properly handle picks of nagtive abscissa values

parent 3c84502b
......@@ -29,11 +29,12 @@
*
* REVISIONS and CHANGES
* - 29/02/2008 V1.0 Thomas Forbriger
* - 05/01/2017 V1.1 properly handle negative values on abszissa
*
* ============================================================================
*/
#define STUPLO_SCALING_CC_VERSION \
"STUPLO_SCALING_CC V1.0 "
"STUPLO_SCALING_CC V1.1"
#include <libtime++.h>
#include "scaling.h"
......@@ -68,10 +69,24 @@ namespace stuplo {
void PanelTime::setrange(const pgplot::Trange& range)
{
libtime::TRelativeTime begin=libtime::double2time(range.min);
libtime::TRelativeTime end=libtime::double2time(range.max);
libtime::TAbsoluteTime abegin=Mreferencetime+begin;
libtime::TAbsoluteTime aend=Mreferencetime+end;
libtime::TAbsoluteTime abegin;
libtime::TAbsoluteTime aend;
if (range.min<0)
{
abegin=Mreferencetime-libtime::double2time(-range.min);
}
else
{
abegin=Mreferencetime+libtime::double2time(range.min);
}
if (range.max<0)
{
aend=Mreferencetime-libtime::double2time(-range.max);
}
else
{
aend=Mreferencetime+libtime::double2time(range.max);
}
this->setrange(libtime::TRange(abegin, aend));
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment