Loading common/view/view.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -564,7 +564,7 @@ struct VIEW::drawItem bool operator()( VIEW_ITEM* aItem ) { // Conditions that have te be fulfilled for an item to be drawn bool drawCondition = aItem->ViewIsVisible() && bool drawCondition = aItem->isRenderable() && aItem->ViewGetLOD( layer ) < view->m_scale; if( !drawCondition ) return true; Loading common/view/view_item.cpp +0 −11 Original line number Diff line number Diff line Loading @@ -29,17 +29,6 @@ using namespace KIGFX; void VIEW_ITEM::ViewSetVisible( bool aIsVisible ) { // update only if the visibility has really changed if( m_visible != aIsVisible ) { m_visible = aIsVisible; ViewUpdate( APPEARANCE ); } } void VIEW_ITEM::ViewRelease() { if( m_view && m_view->IsDynamic() ) Loading include/view/view_item.h +54 −4 Original line number Diff line number Diff line Loading @@ -76,7 +76,17 @@ public: ALL = 0xff }; VIEW_ITEM() : m_view( NULL ), m_visible( true ), m_requiredUpdate( ALL ), /** * Enum VIEW_VISIBILITY_FLAGS. * Defines the visibility of the item (temporarily hidden, invisible, etc). */ enum VIEW_VISIBILITY_FLAGS { VISIBLE = 0x01, /// Item is visible (in general) HIDDEN = 0x02 /// Item is temporarily hidden (e.g. being used by a tool). Overrides VISIBLE flag. }; VIEW_ITEM() : m_view( NULL ), m_flags( VISIBLE ), m_requiredUpdate( ALL ), m_groups( NULL ), m_groupsSize( 0 ) {} /** Loading Loading @@ -128,7 +138,38 @@ public: * * @param aIsVisible: whether the item is visible (on all layers), or not. */ void ViewSetVisible( bool aIsVisible = true ); void ViewSetVisible( bool aIsVisible = true ) { bool cur_visible = m_flags & VISIBLE; if( cur_visible != aIsVisible ) { if(aIsVisible) m_flags |= VISIBLE; else m_flags &= ~VISIBLE; ViewUpdate( APPEARANCE | COLOR ); } } /** * Function ViewHide() * Temporarily hides the item in the view (e.g. for overlaying) * * @param aHide: whether the item is hidden (on all layers), or not. */ void ViewHide ( bool aHide = true ) { if(! (m_flags & VISIBLE) ) return; if(aHide) m_flags |= HIDDEN; else m_flags &= ~HIDDEN; ViewUpdate( APPEARANCE ); } /** * Function ViewIsVisible() Loading @@ -139,7 +180,7 @@ public: */ bool ViewIsVisible() const { return m_visible; return m_flags & VISIBLE; } /** Loading Loading @@ -201,7 +242,7 @@ protected: } VIEW* m_view; ///< Current dynamic view the item is assigned to. bool m_visible; ///< Are we visible in the current dynamic VIEW. int m_flags; ///< Visibility flags int m_requiredUpdate; ///< Flag required for updating ///* Helper for storing cached items group ids Loading Loading @@ -295,6 +336,15 @@ protected: { m_requiredUpdate = NONE; } /** * Function isRenderable() * Returns if the item should be drawn or not. */ bool isRenderable() const { return m_flags == VISIBLE; } }; } // namespace KIGFX Loading Loading
common/view/view.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -564,7 +564,7 @@ struct VIEW::drawItem bool operator()( VIEW_ITEM* aItem ) { // Conditions that have te be fulfilled for an item to be drawn bool drawCondition = aItem->ViewIsVisible() && bool drawCondition = aItem->isRenderable() && aItem->ViewGetLOD( layer ) < view->m_scale; if( !drawCondition ) return true; Loading
common/view/view_item.cpp +0 −11 Original line number Diff line number Diff line Loading @@ -29,17 +29,6 @@ using namespace KIGFX; void VIEW_ITEM::ViewSetVisible( bool aIsVisible ) { // update only if the visibility has really changed if( m_visible != aIsVisible ) { m_visible = aIsVisible; ViewUpdate( APPEARANCE ); } } void VIEW_ITEM::ViewRelease() { if( m_view && m_view->IsDynamic() ) Loading
include/view/view_item.h +54 −4 Original line number Diff line number Diff line Loading @@ -76,7 +76,17 @@ public: ALL = 0xff }; VIEW_ITEM() : m_view( NULL ), m_visible( true ), m_requiredUpdate( ALL ), /** * Enum VIEW_VISIBILITY_FLAGS. * Defines the visibility of the item (temporarily hidden, invisible, etc). */ enum VIEW_VISIBILITY_FLAGS { VISIBLE = 0x01, /// Item is visible (in general) HIDDEN = 0x02 /// Item is temporarily hidden (e.g. being used by a tool). Overrides VISIBLE flag. }; VIEW_ITEM() : m_view( NULL ), m_flags( VISIBLE ), m_requiredUpdate( ALL ), m_groups( NULL ), m_groupsSize( 0 ) {} /** Loading Loading @@ -128,7 +138,38 @@ public: * * @param aIsVisible: whether the item is visible (on all layers), or not. */ void ViewSetVisible( bool aIsVisible = true ); void ViewSetVisible( bool aIsVisible = true ) { bool cur_visible = m_flags & VISIBLE; if( cur_visible != aIsVisible ) { if(aIsVisible) m_flags |= VISIBLE; else m_flags &= ~VISIBLE; ViewUpdate( APPEARANCE | COLOR ); } } /** * Function ViewHide() * Temporarily hides the item in the view (e.g. for overlaying) * * @param aHide: whether the item is hidden (on all layers), or not. */ void ViewHide ( bool aHide = true ) { if(! (m_flags & VISIBLE) ) return; if(aHide) m_flags |= HIDDEN; else m_flags &= ~HIDDEN; ViewUpdate( APPEARANCE ); } /** * Function ViewIsVisible() Loading @@ -139,7 +180,7 @@ public: */ bool ViewIsVisible() const { return m_visible; return m_flags & VISIBLE; } /** Loading Loading @@ -201,7 +242,7 @@ protected: } VIEW* m_view; ///< Current dynamic view the item is assigned to. bool m_visible; ///< Are we visible in the current dynamic VIEW. int m_flags; ///< Visibility flags int m_requiredUpdate; ///< Flag required for updating ///* Helper for storing cached items group ids Loading Loading @@ -295,6 +336,15 @@ protected: { m_requiredUpdate = NONE; } /** * Function isRenderable() * Returns if the item should be drawn or not. */ bool isRenderable() const { return m_flags == VISIBLE; } }; } // namespace KIGFX Loading