From: Douglas W. <dwi...@us...> - 2005-06-02 07:51:06
|
Update of /cvsroot/hugin/hugin/src/hugin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25094/src/hugin Modified Files: CPEditorPanel.cpp CPImageCtrl.cpp Log Message: Ensure control point editor tab is cleared when there are no images Index: CPImageCtrl.cpp =================================================================== RCS file: /cvsroot/hugin/hugin/src/hugin/CPImageCtrl.cpp,v retrieving revision 1.50 retrieving revision 1.51 diff -u -d -r1.50 -r1.51 --- CPImageCtrl.cpp 21 May 2005 12:06:38 -0000 1.50 +++ CPImageCtrl.cpp 2 Jun 2005 07:50:54 -0000 1.51 @@ -222,20 +222,28 @@ #endif // draw image (FIXME, redraw only visible regions.) if (editState != NO_IMAGE) { + //clear the blank rectangle to the left of the image if (bitmap.GetWidth() < vSize.GetWidth()) { dc.SetPen(wxPen(GetBackgroundColour(), 1, wxSOLID)); dc.SetBrush(wxBrush(GetBackgroundColour(),wxSOLID)); dc.DrawRectangle(bitmap.GetWidth(), 0, vSize.GetWidth() - bitmap.GetWidth(),vSize.GetHeight()); } + //clear the blank rectangle below the image if (bitmap.GetHeight() < vSize.GetHeight()) { dc.SetPen(wxPen(GetBackgroundColour(), 1, wxSOLID)); dc.SetBrush(wxBrush(GetBackgroundColour(),wxSOLID)); - dc.DrawRectangle(0, bitmap.GetHeight(), + dc.DrawRectangle(0, bitmap.GetHeight(), vSize.GetWidth(), vSize.GetHeight() - bitmap.GetHeight()); } dc.DrawBitmap(bitmap,0,0); - } + } else { + // clear the rectangle and exit + dc.SetPen(wxPen(GetBackgroundColour(), 1, wxSOLID)); + dc.SetBrush(wxBrush(GetBackgroundColour(),wxSOLID)); + dc.Clear(); + return; + } // draw known points. unsigned int i=0; @@ -748,7 +756,6 @@ void CPImageCtrl::update() { - if (editState == NO_IMAGE) return; DEBUG_TRACE("edit state:" << editState); wxClientDC dc(this); PrepareDC(dc); Index: CPEditorPanel.cpp =================================================================== RCS file: /cvsroot/hugin/hugin/src/hugin/CPEditorPanel.cpp,v retrieving revision 1.99 retrieving revision 1.100 diff -u -d -r1.99 -r1.100 --- CPEditorPanel.cpp 28 May 2005 22:28:00 -0000 1.99 +++ CPEditorPanel.cpp 2 Jun 2005 07:50:53 -0000 1.100 @@ -1259,7 +1259,7 @@ setRightImage(0); } - if (update) { + if (update || nrImages == 0) { UpdateDisplay(); } } @@ -1274,12 +1274,10 @@ int fI = m_leftTabs->GetSelection(); int sI = m_rightTabs->GetSelection(); #endif - if (fI < 0 || m_leftImageNr == UINT_MAX || m_rightImageNr == UINT_MAX) { - return; - } - m_leftImageNr = (unsigned int) fI; - m_rightImageNr = (unsigned int) sI; - + if (fI >= 0 && m_leftImageNr != UINT_MAX && m_rightImageNr != UINT_MAX) { + m_leftImageNr = (unsigned int) fI; + m_rightImageNr = (unsigned int) sI; + } // reset selection m_x1Text->Clear(); m_y1Text->Clear(); |