From 1fcbdea9908917584775d82176e9925ff55bdfa8 Mon Sep 17 00:00:00 2001 From: Phil Cowans Date: Mon, 30 Oct 2006 15:49:13 +0000 Subject: [PATCH] Fixing a couple of bugs * Fixing a couple of bugs --- Src/DasherCore/DasherInterfaceBase.cpp | 7 ++++++- Src/DasherCore/DasherModel.cpp | 4 +--- Src/DasherCore/DasherViewSquare.cpp | 11 +++++++++++ Src/DasherCore/DasherViewSquare.h | 2 ++ 4 files changed, 20 insertions(+), 4 deletions(-) diff --git a/Src/DasherCore/DasherInterfaceBase.cpp b/Src/DasherCore/DasherInterfaceBase.cpp index 6427e0ee..dbbaf6f0 100644 --- a/Src/DasherCore/DasherInterfaceBase.cpp +++ b/Src/DasherCore/DasherInterfaceBase.cpp @@ -526,8 +526,9 @@ void CDasherInterfaceBase::Redraw(bool bRedrawNodes) { } bool bActionButtonsChanged(false); - +#ifdef EXPERIMENTAL_FEATURES bActionButtonsChanged = DrawActionButtons(); +#endif if(bRedrawNodes || bDecorationsChanged || bActionButtonsChanged) m_pDasherView->Display(); @@ -971,6 +972,7 @@ bool CDasherInterfaceBase::DrawActionButtons() { void CDasherInterfaceBase::HandleClickUp(int iTime, int iX, int iY) { +#ifdef EXPERIMENTAL_FEATURES bool bVisible(GetBoolParameter(BP_DASHER_PAUSED)); for(std::vector::iterator it(m_vLeftButtons.begin()); it != m_vLeftButtons.end(); ++it) { @@ -982,11 +984,13 @@ void CDasherInterfaceBase::HandleClickUp(int iTime, int iX, int iY) { if((*it)->HandleClickUp(iTime, iX, iY, bVisible)) return; } +#endif KeyUp(iTime, 100); } void CDasherInterfaceBase::HandleClickDown(int iTime, int iX, int iY) { +#ifdef EXPERIMENTAL_FEATURES bool bVisible(GetBoolParameter(BP_DASHER_PAUSED)); for(std::vector::iterator it(m_vLeftButtons.begin()); it != m_vLeftButtons.end(); ++it) { @@ -998,6 +1002,7 @@ void CDasherInterfaceBase::HandleClickDown(int iTime, int iX, int iY) { if((*it)->HandleClickDown(iTime, iX, iY, bVisible)) return; } +#endif KeyDown(iTime, 100); } diff --git a/Src/DasherCore/DasherModel.cpp b/Src/DasherCore/DasherModel.cpp index a56c126c..d532e25a 100644 --- a/Src/DasherCore/DasherModel.cpp +++ b/Src/DasherCore/DasherModel.cpp @@ -846,19 +846,17 @@ bool CDasherModel::CheckForNewRoot(CDasherView *pView) { CDasherNode *root(m_Root); CDasherNode::ChildMap & children = m_Root->Children(); - + if(pView->IsNodeVisible(m_Rootmin,m_Rootmax)) { Reparent_root(root->Lbnd(), root->Hbnd()); return(m_Root != root); } - if(children.size() == 0) return false; int alive = 0; CDasherNode *theone = 0; - // Find whether there is exactly one alive child; if more, we don't care. CDasherNode::ChildMap::iterator i; diff --git a/Src/DasherCore/DasherViewSquare.cpp b/Src/DasherCore/DasherViewSquare.cpp index c0b02e7d..e4c0152d 100644 --- a/Src/DasherCore/DasherViewSquare.cpp +++ b/Src/DasherCore/DasherViewSquare.cpp @@ -207,6 +207,17 @@ CDasherViewSquare::Cymap::Cymap(myint iScale) { } +bool CDasherViewSquare::IsNodeVisible(myint y1, myint y2) { + myint iDasherMinX; + myint iDasherMinY; + myint iDasherMaxX; + myint iDasherMaxY; + + VisibleRegion(iDasherMinX, iDasherMinY, iDasherMaxX, iDasherMaxY); + + return ((y2 - y1) < iDasherMaxX) || ((y1 > iDasherMinY) && (y2 < iDasherMaxY)); +} + int CDasherViewSquare::RenderNode(const int Color, myint y1, myint y2, int &mostleft, const std::string &sDisplayText, bool bShove) { diff --git a/Src/DasherCore/DasherViewSquare.h b/Src/DasherCore/DasherViewSquare.h index 73041d13..1d481c69 100644 --- a/Src/DasherCore/DasherViewSquare.h +++ b/Src/DasherCore/DasherViewSquare.h @@ -137,6 +137,8 @@ private: int RenderNode(const int Color, myint y1, myint y2, int &mostleft, const std::string &sDisplayText, bool bShove); + bool IsNodeVisible(myint y1, myint y2); + void RecursiveRenderGroups(SGroupInfo *pCurrentGroup, CDasherNode *pNode, myint y1, myint y2, int mostleft); /// -- 2.11.4.GIT