[Marble-commits] KDE/kdeedu/marble/src/plugins/render/geodata
Thibaut Gridel
tgridel at free.fr
Sat Jul 17 11:09:46 CEST 2010
SVN commit 1150967 by tgridel:
GeoRenderGeometry: do not render LineStrings as polygons as well
M +12 -11 GeoRendererView.cpp
--- trunk/KDE/kdeedu/marble/src/plugins/render/geodata/GeoRendererView.cpp #1150966:1150967
@@ -211,14 +211,15 @@
bool GeoRendererView::renderGeoDataGeometry( GeoDataGeometry *object, QString styleUrl )
{
- m_painter->save();
- m_painter->autoMapQuality();
-
if( !m_root ) {
qWarning() << "root seems to be 0!!!";
return false;
}
+ m_painter->save();
+ m_painter->autoMapQuality();
+
+
QString mapped = styleUrl;
const GeoDataStyleMap& styleMap = m_root->styleMap( styleUrl.remove( '#' ) );
@@ -229,24 +230,24 @@
mapped.remove( '#' );
- if( dynamic_cast<GeoDataPolygon*>( object ) ) {
- setBrushStyle( mapped );
- setPenStyle( mapped );
- // geometries are implicitly shared, this shouldn't hurt
- GeoDataPolygon polygon( *object );
- m_painter->drawPolygon( polygon );
- }
if( dynamic_cast<GeoDataLinearRing*>( object ) ) {
m_painter->setBrush( QColor( 0, 0, 0, 0 ) );
setPenStyle( mapped );
GeoDataLinearRing linearRing( *object );
m_painter->drawPolygon( linearRing );
}
- if( dynamic_cast<GeoDataLineString*>( object ) ) {
+ else if( dynamic_cast<GeoDataLineString*>( object ) ) {
setPenStyle( mapped );
GeoDataLineString lineString( *object );
m_painter->drawPolyline( lineString );
}
+ else if( dynamic_cast<GeoDataPolygon*>( object ) ) {
+ setBrushStyle( mapped );
+ setPenStyle( mapped );
+ // geometries are implicitly shared, this shouldn't hurt
+ GeoDataPolygon polygon( *object );
+ m_painter->drawPolygon( polygon );
+ }
/* Note: GeoDataMultiGeometry is handled within the model */
m_painter->restore();
return true;
More information about the Marble-commits
mailing list