Changeset - fbe70e32bc1a
[Not reviewed]
Hasan Yavuz Ă–ZDERYA - 8 years ago 2017-08-16 08:26:42
hy@ozderya.net
fix wrong view size, y axis scroll is broken
1 file changed with 3 insertions and 2 deletions:
0 comments (0 inline, 0 general)
src/scrollzoomer.cpp
Show inline comments
 
@@ -73,31 +73,32 @@ void ScrollZoomer::setXLimits(double min
 
}
 

	
 
void ScrollZoomer::setHViewSize(double size)
 
{
 
    hViewSize = size;
 
}
 

	
 
void ScrollZoomer::setZoomBase(bool doReplot)
 
{
 
    QwtPlotZoomer::setZoomBase(doReplot);
 
    auto zb = zoomBase();
 
    auto zs = zoomStack();
 
    zb.setRight(xMax);
 
    if ((xMax - xMin) < hViewSize)
 
    {
 
        zb.setWidth(xMax - xMin);
 
        zb.setLeft(xMin);
 
    }
 
    else
 
    {
 
        zb.setWidth(hViewSize);
 
        zb.setLeft(xMax-hViewSize);
 
    }
 
    zs[0] = zb;
 
    setZoomStack(zs);
 
}
 

	
 
void ScrollZoomer::rescale()
 
{
 
    QwtScaleWidget *xScale = plot()->axisWidget( xAxis() );
 
    QwtScaleWidget *yScale = plot()->axisWidget( yAxis() );
 

	
 
    if ( zoomRectIndex() <= 0 )
 
    {
0 comments (0 inline, 0 general)