From c02ebf817b3d0ffda7fab195d88a21791cbd2017 Mon Sep 17 00:00:00 2001 From: jkriege2 Date: Thu, 3 Sep 2020 22:56:38 +0200 Subject: [PATCH] added function to check whether axis is linear --- lib/jkqtplotter/jkqtpcoordinateaxes.cpp | 8 +++++++- lib/jkqtplotter/jkqtpcoordinateaxes.h | 3 +++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/jkqtplotter/jkqtpcoordinateaxes.cpp b/lib/jkqtplotter/jkqtpcoordinateaxes.cpp index 4b913566f8..51771e5da4 100644 --- a/lib/jkqtplotter/jkqtpcoordinateaxes.cpp +++ b/lib/jkqtplotter/jkqtpcoordinateaxes.cpp @@ -20,6 +20,7 @@ #include "jkqtplotter/jkqtpcoordinateaxes.h" #include "jkqtplotter/jkqtpbaseplotter.h" #include "jkqtcommon/jkqtpdrawingtools.h" +#include "jkqtcommon/jkqtpgeometrytools.h" #include #include #include @@ -573,7 +574,12 @@ void JKQTPCoordinateAxis::calcPlotScaling(bool force) { } bool JKQTPCoordinateAxis::isLogAxis() const { - return logAxis || (axisStyle.tickMode==JKQTPLTMPower); + return logAxis;// || (axisStyle.tickMode==JKQTPLTMPower); +} + +bool JKQTPCoordinateAxis::isLinearAxis() const +{ + return !logAxis; } const JKQTPCoordinateAxisStyle &JKQTPCoordinateAxis::getCurrentAxisStyle() const diff --git a/lib/jkqtplotter/jkqtpcoordinateaxes.h b/lib/jkqtplotter/jkqtpcoordinateaxes.h index 2b7ea42758..1f0088442d 100644 --- a/lib/jkqtplotter/jkqtpcoordinateaxes.h +++ b/lib/jkqtplotter/jkqtpcoordinateaxes.h @@ -365,6 +365,9 @@ class JKQTPLOTTER_LIB_EXPORT JKQTPCoordinateAxis: public QObject { /** \brief returns whether this axis uses logarithmic scaling */ bool isLogAxis() const; + /** \brief returns whether this axis uses linear scaling (is false e.g. for isLogAxis()==true) */ + bool isLinearAxis() const; + /** \brief current style properties for this JKQTBasePlotter *