[Marble-commits] branches/KDE/4.3/kdeedu/marble/src/lib
Torsten Rahn
tackat at kde.org
Sat Jul 18 23:19:59 CEST 2009
SVN commit 998984 by rahn:
- Patch for the drawEllipse-Crash triggered by the recent memleak fix
M +3 -4 GeoPainter.cpp
M +7 -2 geodata/data/GeoDataLineString.cpp
--- branches/KDE/4.3/kdeedu/marble/src/lib/GeoPainter.cpp #998983:998984
@@ -283,7 +283,8 @@
GeoDataLatLonBox ellipseBox( centerLat + 0.5 * height, centerLat - 0.5 * height,
centerLon + 0.5 * width, centerLon - 0.5 * width,
GeoDataCoordinates::Degree );
- if ( !d->m_viewport->resolves( ellipseBox ) ) return;
+ if ( !d->m_viewport->viewLatLonAltBox().intersects( ellipseBox ) ||
+ !d->m_viewport->resolves( ellipseBox ) ) return;
GeoDataLinearRing ellipse;
qreal lon = 0.0;
@@ -310,7 +311,7 @@
lon = centerLon + 0.5 * width * t;
ellipse << GeoDataCoordinates( lon, lat, altitude, GeoDataCoordinates::Degree );
}
-
+
drawPolygon( ellipse );
}
@@ -425,9 +426,7 @@
// qDebug() << "Polygon doesn't get displayed on the viewport";
return;
}
-// qDebug() << "Drawing Polygon";
-
if ( !linearRing.latLonAltBox().crossesDateLine() ) {
QVector<QPolygonF*> polygons;
d->createPolygonsFromLinearRing( linearRing, polygons );
--- branches/KDE/4.3/kdeedu/marble/src/lib/geodata/data/GeoDataLineString.cpp #998983:998984
@@ -207,6 +207,7 @@
void GeoDataLineString::append ( const GeoDataCoordinates& value )
{
GeoDataGeometry::detach();
+ p()->m_rangeCorrected.clear();
p()->m_dirtyRange = true;
p()->m_dirtyBox = true;
p()->m_vector.append( value );
@@ -215,6 +216,7 @@
GeoDataLineString& GeoDataLineString::operator << ( const GeoDataCoordinates& value )
{
GeoDataGeometry::detach();
+ p()->m_rangeCorrected.clear();
p()->m_dirtyRange = true;
p()->m_dirtyBox = true;
p()->m_vector.append( value );
@@ -224,6 +226,7 @@
void GeoDataLineString::clear()
{
GeoDataGeometry::detach();
+ p()->m_rangeCorrected.clear();
p()->m_dirtyRange = true;
p()->m_dirtyBox = true;
@@ -296,13 +299,13 @@
{
if ( p()->m_dirtyRange ) {
- qDeleteAll( p()->m_rangeCorrected );
+ qDeleteAll( p()->m_rangeCorrected ); // This shouldn't be needed
GeoDataLineString poleCorrected = toPoleCorrected();
p()->m_rangeCorrected = poleCorrected.toDateLineCorrected();
}
-
+
return p()->m_rangeCorrected;
}
@@ -525,6 +528,7 @@
QVector<GeoDataCoordinates>::Iterator GeoDataLineString::erase ( QVector<GeoDataCoordinates>::Iterator pos )
{
GeoDataGeometry::detach();
+ p()->m_rangeCorrected.clear();
p()->m_dirtyRange = true;
p()->m_dirtyBox = true;
return p()->m_vector.erase( pos );
@@ -534,6 +538,7 @@
QVector<GeoDataCoordinates>::Iterator end )
{
GeoDataGeometry::detach();
+ p()->m_rangeCorrected.clear();
p()->m_dirtyRange = true;
p()->m_dirtyBox = true;
return p()->m_vector.erase( begin, end );
More information about the Marble-commits
mailing list