Commit 8bdf3484 authored by David Saxton's avatar David Saxton

Improved axis labels:

- Adjust precision so that the axis labels along an axis change in only 1 or 2
  decimal positions.
- Display scientific formatting properly - e.g. "1.2x10^-4" instead of "1.2e-4".

svn path=/trunk/KDE/kdeedu/kmplot/; revision=530438
parent 3e92444f
......@@ -87,7 +87,7 @@ View::View( bool readOnly, bool & modified, KMenu * functionPopup, QWidget* pare
m_drawIntegral = false;
m_width = m_height = 0.0;
m_scaler = 0.0;
rootflg = false;
m_haveRoot = false;
tlgx = tlgy = drskalx = drskaly = 0.0;
m_ymin = 0.0;
m_ymax = 0.0;
......@@ -154,7 +154,7 @@ void View::draw( QPaintDevice * dev, PlotMedium medium )
}
wm = DC.matrix();
m_scaler=( QPoint(1000, 0) * DC.matrix() ).x()/1000.;
dgr.Create( ref, lx, ly, m_xmin, m_xmax, m_ymin, m_ymax );
CDiagr::self()->Create( ref, lx, ly, m_xmin, m_xmax, m_ymin, m_ymax );
break;
}
......@@ -168,9 +168,9 @@ void View::draw( QPaintDevice * dev, PlotMedium medium )
m_scaler = 1.;
m_printHeaderTable = ( ( KPrinter* ) dev )->option( "app-kmplot-printtable" ) != "-1";
drawHeaderTable( &DC );
dgr.Create( ref, lx, ly, m_xmin, m_xmax, m_ymin, m_ymax );
CDiagr::self()->Create( ref, lx, ly, m_xmin, m_xmax, m_ymin, m_ymax );
if ( ( (KPrinter* )dev )->option( "app-kmplot-printbackground" ) == "-1" )
DC.fillRect( dgr.GetFrame(), backgroundcolor); //draw a colored background
DC.fillRect( CDiagr::self()->frame(), backgroundcolor); //draw a colored background
//DC.end();
//((QPixmap *)dev)->fill(QColor("#FF00FF"));
//DC.begin(dev);
......@@ -182,8 +182,8 @@ void View::draw( QPaintDevice * dev, PlotMedium medium )
ref=QPoint(0, 0);
lx=((m_xmax-m_xmin)*100.*drskalx/tlgx);
ly=((m_ymax-m_ymin)*100.*drskaly/tlgy);
dgr.Create( ref, lx, ly, m_xmin, m_xmax, m_ymin, m_ymax );
DC.translate(-dgr.GetFrame().left(), -dgr.GetFrame().top());
CDiagr::self()->Create( ref, lx, ly, m_xmin, m_xmax, m_ymin, m_ymax );
DC.translate(-CDiagr::self()->frame().left(), -CDiagr::self()->frame().top());
m_scaler=1.;
break;
}
......@@ -194,25 +194,25 @@ void View::draw( QPaintDevice * dev, PlotMedium medium )
ref=QPoint(0, 0);
lx=((m_xmax-m_xmin)*100.*drskalx/tlgx);
ly=((m_ymax-m_ymin)*100.*drskaly/tlgy);
dgr.Create( ref, lx, ly, m_xmin, m_xmax, m_ymin, m_ymax );
CDiagr::self()->Create( ref, lx, ly, m_xmin, m_xmax, m_ymin, m_ymax );
DC.end();
*((QPixmap *)dev) = QPixmap( (int)(dgr.GetFrame().width()*sf), (int)(dgr.GetFrame().height()*sf) );
*((QPixmap *)dev) = QPixmap( (int)(CDiagr::self()->frame().width()*sf), (int)(CDiagr::self()->frame().height()*sf) );
((QPixmap *)dev)->fill(backgroundcolor);
DC.begin(dev);
DC.translate(-dgr.GetFrame().left()*sf, -dgr.GetFrame().top()*sf);
DC.translate(-CDiagr::self()->frame().left()*sf, -CDiagr::self()->frame().top()*sf);
DC.scale(sf, sf);
m_scaler=1.;
break;
}
}
dgr.updateSettings();
dgr.Skal( tlgx, tlgy );
CDiagr::self()->updateSettings();
CDiagr::self()->Skal( tlgx, tlgy );
DC.setRenderHint( QPainter::Antialiasing, true );
dgr.Plot(&DC);
CDiagr::self()->Plot(&DC);
PlotArea=dgr.GetPlotArea();
PlotArea=CDiagr::self()->plotArea();
area=DC.matrix().mapRect(PlotArea);
isDrawing=true;
......@@ -421,14 +421,14 @@ void View::plotFunction(Function *ufkt, QPainter *pDC)
while ( x>=dmin && x<=dmax )
{
p2 = dgr.toPixel( realValue( ufkt, p_mode, x ), CDiagr::ClipInfinite );
p2 = CDiagr::self()->toPixel( realValue( ufkt, p_mode, x ), CDiagr::ClipInfinite );
bool dxAtMinimum = (dx <= base_dx*(5e-5));
bool dxAtMaximum = (dx >= base_dx*(5e+1));
bool dxTooBig = false;
bool dxTooSmall = false;
if ( dgr.xclipflg || dgr.yclipflg )
if ( CDiagr::self()->xclipflg || CDiagr::self()->yclipflg )
{
p1=p2;
}
......@@ -456,7 +456,7 @@ void View::plotFunction(Function *ufkt, QPainter *pDC)
if(mflg<=1)
{
if ( drawIntegral && (x >= m_integralDrawSettings.dmin) && (x <= m_integralDrawSettings.dmax) )
pDC->drawRect( QRectF( p1, QSizeF( p2.x()-p1.x(), p2.y() - dgr.yToPixel( 0 ) ) ) );
pDC->drawRect( QRectF( p1, QSizeF( p2.x()-p1.x(), p2.y() - CDiagr::self()->yToPixel( 0 ) ) ) );
else
{
if ( penShouldDraw( totalLength, ufkt, p_mode ) )
......@@ -781,7 +781,7 @@ void View::setpi(QString *s)
bool View::root(double *x0, Equation *it)
{
if(rootflg)
if(m_haveRoot)
return false;
int k = 0; // iteration count
......@@ -851,8 +851,8 @@ void View::paintEvent(QPaintEvent *)
{
p.save();
p.setMatrix( wm );
QPointF tl( dgr.xToPixel( m_animateZoomRect.left() ), dgr.yToPixel( m_animateZoomRect.top() ) );
QPointF br( dgr.xToPixel( m_animateZoomRect.right() ), dgr.yToPixel( m_animateZoomRect.bottom() ) );
QPointF tl( CDiagr::self()->xToPixel( m_animateZoomRect.left() ), CDiagr::self()->yToPixel( m_animateZoomRect.top() ) );
QPointF br( CDiagr::self()->xToPixel( m_animateZoomRect.right() ), CDiagr::self()->yToPixel( m_animateZoomRect.bottom() ) );
p.drawRect( QRectF( tl, QSizeF( br.x()-tl.x(), br.y()-tl.y() ) ) );
p.restore();
}
......@@ -974,7 +974,7 @@ void View::mousePressEvent(QMouseEvent *e)
return;
}
rootflg = false;
m_haveRoot = false;
bool hadFunction = (m_currentFunctionID != -1 );
......@@ -1015,7 +1015,7 @@ void View::mousePressEvent(QMouseEvent *e)
Function * function = XParser::self()->functionWithID( m_currentFunctionID );
if ( function )
{
QPointF ptd( dgr.toPixel( closestPoint ) );
QPointF ptd( CDiagr::self()->toPixel( closestPoint ) );
QPoint globalPos = mapToGlobal( (ptd * wm).toPoint() );
QCursor::setPos( globalPos );
......@@ -1122,7 +1122,7 @@ double View::getClosestPoint( const QPointF & pos, Function * function, Function
{
double best_pixel_x = 0.0;
QPointF pixelPos = dgr.toPixel( pos, CDiagr::ClipInfinite );
QPointF pixelPos = CDiagr::self()->toPixel( pos, CDiagr::ClipInfinite );
double dmin = getXmin( function );
double dmax = getXmax( function );
......@@ -1143,11 +1143,11 @@ double View::getClosestPoint( const QPointF & pos, Function * function, Function
double y1 = XParser::self()->fkt( function->eq[0], x );
double _x0 = dgr.xToPixel( x-stepSize, CDiagr::ClipInfinite );
double _x1 = dgr.xToPixel( x, CDiagr::ClipInfinite );
double _x0 = CDiagr::self()->xToPixel( x-stepSize, CDiagr::ClipInfinite );
double _x1 = CDiagr::self()->xToPixel( x, CDiagr::ClipInfinite );
double _y0 = dgr.yToPixel( y0, CDiagr::ClipInfinite );
double _y1 = dgr.yToPixel( y1, CDiagr::ClipInfinite );
double _y0 = CDiagr::self()->yToPixel( y0, CDiagr::ClipInfinite );
double _y1 = CDiagr::self()->yToPixel( y1, CDiagr::ClipInfinite );
double k = (_y1-_y0)/(_x1-_x0);
......@@ -1157,7 +1157,7 @@ double View::getClosestPoint( const QPointF & pos, Function * function, Function
else
closest_x = (pixelPos.y() + pixelPos.x()/k + k*_x0 - _y0) / (k + 1.0/k);
double closest_y = dgr.yToPixel( value( function->eq[0], mode, dgr.xToReal( closest_x ) ), CDiagr::ClipInfinite );
double closest_y = CDiagr::self()->yToPixel( value( function->eq[0], mode, CDiagr::self()->xToReal( closest_x ) ), CDiagr::ClipInfinite );
double dfx = qAbs( closest_x - pixelPos.x() );
double dfy = qAbs( closest_y - pixelPos.y() );
......@@ -1170,7 +1170,7 @@ double View::getClosestPoint( const QPointF & pos, Function * function, Function
}
}
best_x = dgr.xToReal( best_pixel_x );
best_x = CDiagr::self()->xToReal( best_pixel_x );
}
else
{
......@@ -1209,28 +1209,64 @@ double View::getClosestPoint( const QPointF & pos, Function * function, Function
double View::pixelDistance( const QPointF & pos, Function * function, Function::PMode mode, double x )
{
QPointF f = realValue( function, mode, x );
QPointF df = dgr.toPixel( pos, CDiagr::ClipInfinite ) - dgr.toPixel( f, CDiagr::ClipInfinite );
QPointF df = CDiagr::self()->toPixel( pos, CDiagr::ClipInfinite ) - CDiagr::self()->toPixel( f, CDiagr::ClipInfinite );
return std::sqrt( df.x()*df.x() + df.y()*df.y() );
}
QString View::posToString( double x, double delta ) const
QString View::posToString( double x, double delta, PositionFormatting format, QColor color ) const
{
assert( delta != 0.0 );
int decimalPlaces = 1-int(log(delta)/log(10.0));
QString numberText;
QString number;
if ( decimalPlaces >= 0 )
number = QString::number( x, 'f', decimalPlaces );
else
number = QString::number( x/(pow(10.0,decimalPlaces)), 'f', 0 ) + QString( -decimalPlaces, '0' );
int decimalPlaces = 1-int(log(delta)/log(10.0));
if ( x > 0.0 )
number.prepend('+');
switch ( format )
{
case ScientificFormat:
{
int accuracy = 1 + decimalPlaces + int(log(qAbs(x))/log(10.0));
if ( accuracy < 2 )
{
// Ensure a minimum of two significant digits
accuracy = 2;
}
QString number = QString::number( x, 'g', accuracy );
if ( number.contains( 'e' ) )
{
number.remove( "+0" );
number.remove( "+" );
number.replace( "-0", "-" );
number.replace( 'e', QChar(215) + QString("10<sup>") );
number.append( "</sup>" );
}
if ( x > 0.0 )
number.prepend('+');
numberText = QString("<html><body><span style=\"color:%1;\">").arg( color.name() ) + number + "</span></body></html>";
break;
}
case DecimalFormat:
{
if ( decimalPlaces >= 0 )
numberText = QString::number( x, 'f', decimalPlaces );
else
numberText = QString::number( x/(pow(10.0,decimalPlaces)), 'f', 0 ) + QString( -decimalPlaces, '0' );
if ( x > 0.0 )
numberText.prepend('+');
break;
}
}
return number;
return numberText;
}
......@@ -1240,15 +1276,15 @@ void View::mouseMoveEvent(QMouseEvent *e)
return;
bool inBounds = updateCrosshairPosition();
if ( !rootflg )
if ( !m_haveRoot )
setStatusBar("", 3);
QString sx, sy;
if ( inBounds )
{
sx = "x = " + posToString( m_crosshairPosition.x(), (m_xmax-m_xmin)/area.width() );
sy = "y = " + posToString( m_crosshairPosition.y(), (m_ymax-m_ymin)/area.width() );
sx = "x = " + posToString( m_crosshairPosition.x(), (m_xmax-m_xmin)/area.width(), View::DecimalFormat );
sy = "y = " + posToString( m_crosshairPosition.y(), (m_ymax-m_ymin)/area.width(), View::DecimalFormat );
}
else
sx = sy = "";
......@@ -1299,7 +1335,7 @@ bool View::updateCrosshairPosition()
bool out_of_bounds = false; // for the ypos
QPointF ptl = mousePos * wm.inverted();
m_crosshairPosition = dgr.toReal( ptl );
m_crosshairPosition = CDiagr::self()->toReal( ptl );
Function * it = XParser::self()->functionWithID( m_currentFunctionID );
......@@ -1364,13 +1400,13 @@ bool View::updateCrosshairPosition()
// cartesian plot
m_crosshairPosition.setY( value( it->eq[0], m_currentFunctionPlot, m_crosshairPosition.x() ) );
ptl.setY(dgr.yToPixel( m_crosshairPosition.y() ));
ptl.setY(CDiagr::self()->yToPixel( m_crosshairPosition.y() ));
if ( m_crosshairPosition.y()<m_ymin || m_crosshairPosition.y()>m_ymax) //the ypoint is not visible
{
out_of_bounds = true;
}
else if(fabs(dgr.yToReal(ptl.y())) < (m_ymax-m_ymin)/80)
else if(fabs(CDiagr::self()->yToReal(ptl.y())) < (m_ymax-m_ymin)/80)
{
double x0;
if ( root( &x0, it->eq[0] ) )
......@@ -1378,17 +1414,17 @@ bool View::updateCrosshairPosition()
QString str=" ";
str+=i18n("root");
setStatusBar(str+QString().sprintf(": x0 = %+.5f", x0), 3);
rootflg=true;
m_haveRoot=true;
}
}
else
rootflg=false;
m_haveRoot=false;
}
// For Cartesian plots, only adjust the cursor position if it is not at the ends of the view
if ( (it->type() != Function::Cartesian) || area.contains( mousePos ) )
{
ptl = dgr.toPixel( m_crosshairPosition );
ptl = CDiagr::self()->toPixel( m_crosshairPosition );
QPoint globalPos = mapToGlobal( (ptl * wm).toPoint() );
QCursor::setPos( globalPos );
}
......@@ -1458,8 +1494,8 @@ void View::mouseReleaseEvent ( QMouseEvent * e )
void View::zoomIn( const QPoint & mousePos, double zoomFactor )
{
double realx = dgr.xToReal((mousePos * wm.inverted()).x());
double realy = dgr.yToReal((mousePos * wm.inverted()).y());
double realx = CDiagr::self()->xToReal((mousePos * wm.inverted()).x());
double realy = CDiagr::self()->yToReal((mousePos * wm.inverted()).y());
double diffx = (m_xmax-m_xmin)*zoomFactor;
double diffy = (m_ymax-m_ymin)*zoomFactor;
......@@ -1476,11 +1512,11 @@ void View::zoomIn( const QRect & zoomRect )
QRect rect = wm.inverted().mapRect( zoomRect );
QPoint p = rect.topLeft();
double real1x = dgr.xToReal(p.x() );
double real1y = dgr.yToReal(p.y() );
double real1x = CDiagr::self()->xToReal(p.x() );
double real1y = CDiagr::self()->yToReal(p.y() );
p = rect.bottomRight();
double real2x = dgr.xToReal(p.x() );
double real2y = dgr.yToReal(p.y() );
double real2x = CDiagr::self()->xToReal(p.x() );
double real2y = CDiagr::self()->yToReal(p.y() );
if ( real1x > real2x )
qSwap( real1x, real2x );
......@@ -1502,11 +1538,11 @@ void View::zoomOut( const QRect & zoomRect )
QRect rect = wm.inverted().mapRect( zoomRect );
QPoint p = rect.topLeft();
double _real1x = dgr.xToReal(p.x() );
double _real1y = dgr.yToReal(p.y() );
double _real1x = CDiagr::self()->xToReal(p.x() );
double _real1y = CDiagr::self()->yToReal(p.y() );
p = rect.bottomRight();
double _real2x = dgr.xToReal(p.x() );
double _real2y = dgr.yToReal(p.y() );
double _real2x = CDiagr::self()->xToReal(p.x() );
double _real2y = CDiagr::self()->yToReal(p.y() );
double kx = (_real1x-_real2x)/(m_xmin-m_xmax);
double lx = _real1x - (kx * m_xmin);
......@@ -1607,8 +1643,8 @@ void View::animateZoom( const QRectF & _newCoords )
void View::translateView( int dx, int dy )
{
double rdx = dgr.xToReal( dx / m_scaler ) - dgr.xToReal( 0.0 );
double rdy = dgr.yToReal( dy / m_scaler ) - dgr.yToReal( 0.0 );
double rdx = CDiagr::self()->xToReal( dx / m_scaler ) - CDiagr::self()->xToReal( 0.0 );
double rdy = CDiagr::self()->yToReal( dy / m_scaler ) - CDiagr::self()->yToReal( 0.0 );
m_xmin += rdx;
m_xmax += rdx;
......
......@@ -119,17 +119,36 @@ class View : public QWidget, virtual public ViewIface
* \return the area.
*/
double areaUnderGraph( IntegralDrawSettings settings );
/// the calculation was cancelled by the user
bool isCalculationStopped();
/// the calculation was cancelled by the user
bool isCalculationStopped();
/**
* Used in posToString for requesting how the position string is to be
* created.
*/
enum PositionFormatting
{
DecimalFormat, ///< Plain text, using no scientific notation; just decimal expansion.
ScientificFormat, ///< Rich text, possibly using scientific notation (mult x 10 ^ exp).
};
/**
* @return a string for displaying the x or y coordinate in the statusbar.
* \param x The number to convert to a string.
* \param delta is the amount by which the value varies over one pixel in
* the view. This is for choosing an appropriate number of decimals so that
* moving the cursor shows a nice change in the string.
* \param format How the number should be represented as a string.
* \param color If using scientific mode, the color to format the text.
*/
QString posToString( double x, double delta, PositionFormatting format, QColor color = Qt::black ) const;
/// Slider controlling parameter values
QPointer<KSliderWindow> m_sliderWindow;
/// Menu actions for the sliders
KToggleAction * m_menuSliderAction;
void updateSliders(); /// show only needed sliders
/// Convert a width in mm to a suitable QPen width for drawing
double mmToPenWidth( double width_mm, bool antialias ) const;
/// Slider controlling parameter values
QPointer<KSliderWindow> m_sliderWindow;
/// Menu actions for the sliders
KToggleAction * m_menuSliderAction;
void updateSliders(); /// show only needed sliders
/// Convert a width in mm to a suitable QPen width for drawing
double mmToPenWidth( double width_mm, bool antialias ) const;
/** Current plot range endge. */
double m_xmin;
......@@ -264,13 +283,6 @@ protected:
* given function at \p x.
*/
double pixelDistance( const QPointF & pos, Function * function, Function::PMode mode, double x );
/**
* @return a string for displaying the x or y coordinate in the statusbar.
* \param delta is the amount by which the value varies over one pixel in
* the view. This is for choosing an appropriate number of decimals so that
* moving the cursor shows a nice change in the string.
*/
QString posToString( double x, double delta ) const;
/**
* Convenience function for calculating the value of \p eq using the
......@@ -303,16 +315,23 @@ protected:
QPointF m_crosshairPixelCoords;
QPointF m_crosshairPosition; ///< in real coordinates
/// The t- or x- (angle) coordinate of the traced curve
double m_trace_x;
/// trace mode stuff
bool rootflg;
/**
* The t- or x- (angle) coordinate of the traced curve - when tracing a
* polar or parametric curve.
*/
double m_trace_x;
/**
* When tracing a Cartesian plot and the trace position nears the
* x-axis, an attempt to find a root will be found. If found, this will
* be set to true, and no further attempts will be made at finding a
* root. Once the plot position moves away from the x-axis again, this
* will be set to false.
*/
bool m_haveRoot;
/// @return whether cspos is in the range of the view or in the custom range for the given \p plot
bool crosshairPositionValid( Function * plot ) const;
CDiagr dgr; ///< Coordinate system
QPoint ref;
QRect area,
PlotArea;
......
......@@ -28,6 +28,13 @@
#include "settings.h"
#include "View.h"
#include <kdebug.h>
#include <QAbstractTextDocumentLayout>
#include <QTextDocument>
#include <QTextEdit>
#include <QTextLayout>
//BEGIN nan & inf
#ifdef __osf__
#include <nan.h>
#define isnan(x) IsNAN(x)
......@@ -41,18 +48,38 @@ int isinf(double x)
return !finite(x) && x==x;
}
#endif
//END nan & inf
//BEGIN class CDiagr
CDiagr * CDiagr::m_self = 0;
CDiagr * CDiagr::self()
{
if ( !m_self )
m_self = new CDiagr;
return m_self;
}
#include <kdebug.h>
CDiagr::CDiagr()
{
m_textEdit = new QTextEdit;
m_textEdit->setWordWrapMode( QTextOption::NoWrap );
m_textEdit->setLineWrapMode( QTextEdit::NoWrap );
m_textDocument = m_textEdit->document();
updateSettings();
ex=ey=1.;
}
CDiagr::~CDiagr()
{}
{
m_textEdit->deleteLater();
}
void CDiagr::Create(QPoint Ref, // Bezugspunkt links unten
double lx, double ly, // Achsenl�gen
......@@ -72,7 +99,7 @@ void CDiagr::Create(QPoint Ref, // Bezugspunkt links unten
sky=ly/(ymax-ymin);
ox=Ref.x()-skx*xmin+0.5; // Ursprungskoordinaten berechnen
oy=Ref.y()+sky*ymax+0.5;
PlotArea.setRect(x=Ref.x(), y=Ref.y(), w=int(lx), h=int(ly));
m_plotArea.setRect(x=Ref.x(), y=Ref.y(), w=int(lx), h=int(ly));
if( Settings::showExtraFrame() )
{
x-=20;
......@@ -99,9 +126,9 @@ void CDiagr::Skal( double ex, double ey )
void CDiagr::Plot(QPainter* pDC)
{
QPen pen(QColor(frameColor), View::self()->mmToPenWidth( borderThickness, true ) );
QPen pen( frameColor, View::self()->mmToPenWidth( borderThickness, true ) );
if( g_mode != GRID_NONE )
if( m_gridMode != GridNone )
drawGrid( pDC ); // draw the grid
drawAxes( pDC ); // draw the axes
if( Settings::showLabel() )
......@@ -132,28 +159,28 @@ double CDiagr::xToPixel( double x, ClipBehaviour clipBehaviour ) // reale x-Koo
if(lastx<1. && lastx>-1.)
xi=(ox-skx*lastx);
else
xi=(lastx<0)? PlotArea.left(): PlotArea.right();
xi=(lastx<0)? m_plotArea.left(): m_plotArea.right();
}
else if(isinf(x)==-1)
{
xclipflg=0;
xi=PlotArea.left();
xi=m_plotArea.left();
}
else if(isinf(x)==1)
{
xclipflg=0;
xi=PlotArea.right();
xi=m_plotArea.right();
}
else if ( (x<xmin) && (clipBehaviour == ClipAll) )
{
xclipflg=1;
xi=PlotArea.left();
xi=m_plotArea.left();
}
else if ( (x>xmax) && (clipBehaviour == ClipAll) )
{
xclipflg=1;
xi=PlotArea.right();
xi=m_plotArea.right();
}
else
{
......@@ -176,29 +203,29 @@ double CDiagr::yToPixel( double y, ClipBehaviour clipBehaviour ) // reale y-Koo
if(lasty<1. && lasty>-1.)
yi=(oy-sky*lasty);
else
yi=(lasty<0)? PlotArea.bottom(): PlotArea.top();
yi=(lasty<0)? m_plotArea.bottom(): m_plotArea.top();
}
else if(isinf(y)==-1)
{
yclipflg=0;
yi=PlotArea.bottom();
yi=m_plotArea.bottom();
}
else if(isinf(y)==1)
{
yclipflg=0;
yi=PlotArea.top();
yi=m_plotArea.top();
}
else if ( (y<ymin) && (clipBehaviour == ClipAll) )
{
yclipflg=1;
yi=PlotArea.bottom();
yi=m_plotArea.bottom();
}
else if ( (y>ymax) && (clipBehaviour == ClipAll) )
{
yclipflg=1;
yi=PlotArea.top();
yi=m_plotArea.top();
}
else
{
......@@ -236,10 +263,10 @@ void CDiagr::drawAxes( QPainter* pDC ) // draw axes
if( Settings::showAxes() )
{
pDC->setPen( QPen( QColor(axesColor), View::self()->mmToPenWidth(axesLineWidth, true) ) );
a=PlotArea.right();
pDC->setPen( QPen( axesColor, View::self()->mmToPenWidth(axesLineWidth, true) ) );
a=m_plotArea.right();