diff --git a/common/view/view.cpp b/common/view/view.cpp index 9300869f8b..ab436c31fe 100644 --- a/common/view/view.cpp +++ b/common/view/view.cpp @@ -459,7 +459,8 @@ struct VIEW::drawItem // Draw using cached information or create one int group = aItem->getGroup( currentLayer->id ); - if( group >= 0 && aItem->ViewIsVisible() ) + if( group >= 0 && aItem->ViewIsVisible() && + aItem->ViewGetLOD( currentLayer->id ) < view->m_scale ) { gal->DrawGroup( group ); } @@ -471,7 +472,8 @@ struct VIEW::drawItem gal->EndGroup(); } } - else if( aItem->ViewIsVisible() ) + else if( aItem->ViewIsVisible() && + aItem->ViewGetLOD( currentLayer->id ) < view->m_scale ) { // Immediate mode view->m_painter->Draw( aItem, currentLayer->id ); diff --git a/include/view/view_item.h b/include/view/view_item.h index b1710ca51b..7a3540ed38 100644 --- a/include/view/view_item.h +++ b/include/view/view_item.h @@ -227,6 +227,17 @@ public: return m_viewVisible; } + /** + * Function ViewGetLOD() + * Returns the level of detail of the item. A level of detail is the minimal VIEW scale that + * is sufficient for an item to be shown on a given layer. + */ + virtual unsigned int ViewGetLOD( int aLayer ) const + { + // By default always show the item + return 0; + } + /** * Function ViewUpdate() * For dynamic VIEWs, informs the associated VIEW that the graphical representation of