patch for bounding box initialization

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_2_BRANCH@7487 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2000-05-25 18:29:26 +00:00
parent 92963bc943
commit b0d2cd55b4

View File

@@ -48,6 +48,7 @@ public:
{
m_clipping = FALSE;
m_ok = TRUE;
m_isBBoxValid = FALSE;
m_minX = m_minY = m_maxX = m_maxY = 0;
@@ -399,12 +400,24 @@ public:
// ------------
virtual void CalcBoundingBox(wxCoord x, wxCoord y)
{
if ( m_isBBoxValid )
{
if ( x < m_minX ) m_minX = x;
if ( y < m_minY ) m_minY = y;
if ( x > m_maxX ) m_maxX = x;
if ( y > m_maxY ) m_maxY = y;
}
else
{
m_isBBoxValid = TRUE;
m_minX = x;
m_minY = y;
m_maxX = x;
m_maxY = y;
}
}
// Get the final bounding box of the PostScript or Metafile picture.
wxCoord MinX() const { return m_minX; }
@@ -577,6 +590,7 @@ protected:
bool m_ok:1;
bool m_clipping:1;
bool m_isInteractive:1;
bool m_isBBoxValid:1;
// coordinate system variables