[Marble-commits] KDE/kdeedu/marble/src/lib
Bastian Holst
bastianholst at gmx.de
Wed Oct 13 22:02:04 CEST 2010
SVN commit 1185591 by bholst:
Merge branch 'offbyone'
M +9 -2 MarbleMap.cpp
M +6 -0 MarbleWidget.cpp
--- trunk/KDE/kdeedu/marble/src/lib/MarbleMap.cpp #1185590:1185591
@@ -388,7 +388,6 @@
emit visibleLatLonAltBoxChanged( d->m_viewParams.viewport()->viewLatLonAltBox() );
}
-
bool MarbleMapPrivate::needsUpdate() const
{
return ( m_justModified
@@ -664,8 +663,16 @@
// Prevent infinite loops.
if ( newZoom == d->m_logzoom )
return;
- setRadius( d->radius( newZoom ) );
+ d->m_viewParams.setRadius( d->radius( newZoom ) );
+
+ d->setNeedsUpdate();
+
+ d->m_logzoom = newZoom;
+ emit zoomChanged( d->m_logzoom );
+ emit distanceChanged( distanceString() );
+ emit visibleLatLonAltBoxChanged( d->m_viewParams.viewport()->viewLatLonAltBox() );
+
// We don't do this on every paintEvent to improve performance.
// Redrawing the atmosphere is only needed if the size of the
// globe changes.
--- trunk/KDE/kdeedu/marble/src/lib/MarbleWidget.cpp #1185590:1185591
@@ -501,11 +501,17 @@
void MarbleWidget::zoomView( int newZoom, FlyToMode mode )
{
+ // It won't fly anyway. So we should do everything to keep the zoom value.
+ if ( !d->m_animationsEnabled || mode == Instant ) {
+ d->m_map->zoomView( newZoom );
+ }
+ else {
GeoDataLookAt target = lookAt();
target.setRange( KM2METER * d->m_map->distanceFromZoom( newZoom ) );
flyTo( target, mode );
}
+}
void MarbleWidget::zoomViewBy( int zoomStep, FlyToMode mode )
More information about the Marble-commits
mailing list