// Author: Julian Smart, Robert Roebling
// Modified by:
// Created: 01/02/97
-// RCS-ID: $Id$
// Copyright: (c) Julian Smart, Robert Roebling
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
CalcBoundingBox (x, y);
}
-void wxWindowDCImpl::DoDrawLines( int n, wxPoint points[], wxCoord xoffset, wxCoord yoffset )
+void wxWindowDCImpl::DoDrawLines( int n, const wxPoint points[], wxCoord xoffset, wxCoord yoffset )
{
wxCHECK_RET( IsOk(), wxT("invalid window dc") );
delete[] xpoints;
}
-void wxWindowDCImpl::DoDrawPolygon( int n, wxPoint points[],
+void wxWindowDCImpl::DoDrawPolygon( int n, const wxPoint points[],
wxCoord xoffset, wxCoord yoffset,
wxPolygonFillMode WXUNUSED(fillStyle) )
{
wxCoord *descent, wxCoord *externalLeading,
const wxFont *font ) const
{
- wxCHECK_RET( IsOk(), wxT("invalid dc") );
+ // Do not test for DC validity here, querying text extents is supposed to
+ // work even with a non-initialized wxMemoryDC. And the code below does
+ // actually work in this case.
if (string.empty())
{
wxCoord wxWindowDCImpl::GetCharWidth() const
{
- wxCHECK_MSG( IsOk(), 0, wxT("invalid dc") );
+ // Do not test for DC validity here for the same reasons as in
+ // DoGetTextExtent() above.
#if wxUSE_UNICODE
PangoLayout *layout = pango_layout_new( m_context );
wxCoord wxWindowDCImpl::GetCharHeight() const
{
- wxCHECK_MSG( IsOk(), 0, wxT("invalid dc") );
+ // Do not test for DC validity here for the same reasons as in
+ // DoGetTextExtent() above.
#if wxUSE_UNICODE
PangoLayout *layout = pango_layout_new( m_context );
wxDCImpl::ComputeScaleAndOrigin();
- /* CMB: if scale has changed call SetPen to recalulate the line width */
+ /* CMB: if scale has changed call SetPen to recalculate the line width */
if ((m_scaleX != origScaleX || m_scaleY != origScaleY) &&
(m_pen.IsOk()))
{