Changeset 3290 in ntrip for trunk


Ignore:
Timestamp:
May 31, 2011, 4:00:22 PM (13 years ago)
Author:
weber
Message:

Scaling site distribution map from caster sourcetable contents

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/bncmapview.cpp

    r2985 r3290  
    1717  setCursor(Qt::OpenHandCursor);
    1818  setRenderHints(QPainter::Antialiasing | QPainter::SmoothPixmapTransform);
     19  resetScale();
    1920}
    2021
     
    9091
    9192// -------------
    92 void BncMapView::mouseReleaseEvent(QMouseEvent* /* event */)
     93void BncMapView::mouseReleaseEvent(QMouseEvent* event)
    9394{   
    9495   setCursor(Qt::OpenHandCursor);
     
    126127
    127128     // zooming in
    128      scale( scaleFactor, scaleFactor );
     129     zoom( scaleFactor );
    129130     
    130131   }else{
    131132
    132133     // zooming out
    133      scale( 1.0/scaleFactor, 1.0/scaleFactor );
     134     zoom( 1.0/scaleFactor );
    134135   }
    135136   
     
    156157   QGraphicsView::resizeEvent(event);
    157158}
     159
     160
     161// -------------
     162void BncMapView::resetScale()
     163{
     164  _scale = _scCur = 2.0;
     165  setMatrix(QMatrix(_scale,0,0,_scale,0,0));
     166}
     167
     168
     169// -------------
     170void BncMapView::zoom(qreal scale)
     171{
     172   QGraphicsView::scale( scale, scale );
     173  _scCur = _scCur * scale;
     174}
Note: See TracChangeset for help on using the changeset viewer.