Ignore:
Timestamp:
06/17/12 13:34:25 (22 months ago)
Author:
mstajdohar
Branch:
default
Message:

Auto scale axies in FR.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • source/orangeqt/networkcurve.cpp

    r10919 r10920  
    986986        if (before_refresh_time > refresh_time && i % 2 == 0) 
    987987        { 
     988            QRectF r2 = QRectF(plot().contentsRect()); 
     989            r2.adjust(1, 1, -1, -1); 
     990            double t = r2.top(); 
     991            r2.setTop(r2.bottom()); 
     992            r2.setBottom(t); 
     993 
     994            QPair<int, int> axes = axes(); 
     995            QRectF r1 = plot().data_rect_for_axes(axes.first, axes.second); 
     996 
     997            QTransform tr1 = QTransform().translate(-r1.left(), -r1.top()); 
     998            QTransform ts = QTransform().scale(r2.width()/r1.width(), r2.height()/r1.height()); 
     999            QTransform tr2 = QTransform().translate(r2.left(), r2.top()); 
     1000            set_graph_transform(tr1 * ts * tr2); 
     1001 
    9881002            update_properties(); 
    9891003            QCoreApplication::processEvents(); 
Note: See TracChangeset for help on using the changeset viewer.