diff --git a/docs/latex/wx/dc.tex b/docs/latex/wx/dc.tex index a7ccf42499..8c7a0791a1 100644 --- a/docs/latex/wx/dc.tex +++ b/docs/latex/wx/dc.tex @@ -108,6 +108,18 @@ See \helpref{wxMemoryDC}{wxmemorydc} for typical usage. \helpref{wxMemoryDC}{wxmemorydc}, \helpref{wxBitmap}{wxbitmap}, \helpref{wxMask}{wxmask} +\membersection{wxDC::CalcBoundingBox}\label{wxdccalcboundingbox} + +\func{void}{CalcBoundingBox}{\param{wxCoord }{x}, \param{wxCoord }{y}} + +Adds the specified point to the bounding box which can be retrieved with +\helpref{MinX}{wxdcminx}, \helpref{MaxX}{wxdcmaxx} and +\helpref{MinY}{wxdcminy}, \helpref{MaxY}{wxdcmaxy} functions. + +\wxheading{See also} + +\helpref{ResetBoundingBox}{wxdcresetboundingbox} + \membersection{wxDC::Clear}\label{wxdcclear} \func{void}{Clear}{\void} @@ -579,6 +591,17 @@ Gets the minimum vertical extent used in drawing commands so far. Returns TRUE if the DC is ok to use. +\membersection{wxDC::ResetBoundingBox}\label{wxdcresetboundingbox} + +\func{void}{ResetBoundingBox}{\void} + +Resets the bounding box: after a call to this function, the bounding box +doesn't contain anything. + +\wxheading{See also} + +\helpref{CalcBoundingBox}{wxdccalcboundingbox} + \membersection{wxDC::SetDeviceOrigin}\label{wxdcsetdeviceorigin} \func{void}{SetDeviceOrigin}{\param{wxCoord}{ x}, \param{wxCoord}{ y}} diff --git a/include/wx/dc.h b/include/wx/dc.h index e38a8a9c45..c742d1f64c 100644 --- a/include/wx/dc.h +++ b/include/wx/dc.h @@ -48,9 +48,8 @@ public: { m_clipping = FALSE; m_ok = TRUE; - m_isBBoxValid = FALSE; - m_minX = m_minY = m_maxX = m_maxY = 0; + ResetBoundingBox(); m_signX = m_signY = 1; @@ -419,6 +418,13 @@ public: } } + void ResetBoundingBox() + { + m_isBBoxValid = FALSE; + + m_minX = m_maxX = m_minY = m_maxY = 0; + } + // Get the final bounding box of the PostScript or Metafile picture. wxCoord MinX() const { return m_minX; } wxCoord MaxX() const { return m_maxX; }