Changeset 4657 in ntrip


Ignore:
Timestamp:
Sep 7, 2012, 4:40:20 PM (12 years ago)
Author:
mervart
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/src/bncmap_svg.cpp

    r4656 r4657  
    122122  QwtPlotMarker* marker = new QwtPlotMarker();
    123123  marker->setValue(lonDeg, latDeg);
    124   marker->setLabelAlignment(Qt::AlignRight);
    125   marker->setLabel(QwtText(name.left(4)));
     124  if (lonDeg > 170.0) {
     125    marker->setLabelAlignment(Qt::AlignLeft);
     126  }
     127  else {
     128    marker->setLabelAlignment(Qt::AlignRight);
     129  }
     130  QwtText text(name.left(4));
     131  QFont   font = text.font();
     132  font.setPointSize(font.pointSize()*0.8);
     133  text.setFont(font);
     134  marker->setLabel(text);
    126135  marker->setSymbol(symbol);
    127136  marker->attach(_mapPlot);
     
    171180  if (width > 0 && height > 0) {
    172181    double eps = 0.1;
    173     double epsLon = eps*(_maxPointLon - _minPointLon);
    174     double epsLat = eps*(_maxPointLat - _minPointLat);
    175     double minLon = _minPointLon - epsLon;
    176     double minLat = _minPointLat - epsLat;
    177     double widthExt = width + 2*epsLon;
    178     double heightExt = height + 2*epsLat;
    179     if (minLon < -180.) minLon = -180.;
    180     if (minLat <  -90.) minLat =  -90.;
    181     if (widthExt > 360.) widthExt = 360.;
    182     if (heightExt > 180.) heightExt = 180.;
    183     if (widthExt > 270. || heightExt > 135.) {
    184       QRectF rect(-180.,-90.,360.,180.);
    185       _mapPlotZoomer->zoom(rect);
    186     }
    187     else {
     182    double epsLon    = eps * (_maxPointLon - _minPointLon);
     183    double epsLat    = eps * (_maxPointLat - _minPointLat);
     184    double widthExt  = width  + 2 * epsLon;
     185    double heightExt = height + 2 * epsLat;
     186    double minLon    = _minPointLon - epsLon;
     187    double minLat    = _minPointLat - epsLat;
     188    if (minLon < -180.) minLon = -180.0;
     189    if (minLat <  -90.) minLat =  -90.0;
     190    if (widthExt < 270.0 && heightExt < 135.0) {
    188191      QRectF rect(minLon, minLat, widthExt, heightExt);
    189192      _mapPlotZoomer->zoom(rect);
Note: See TracChangeset for help on using the changeset viewer.