m_OwnsMGLDC = FALSE;
m_ok = FALSE; // must call SetMGLDevCtx() before using it
-#if 0
m_mm_to_pix_x = (double)wxGetDisplaySize().GetWidth() /
(double)wxGetDisplaySizeMM().GetWidth();
m_mm_to_pix_y = (double)wxGetDisplaySize().GetHeight() /
(double)wxGetDisplaySizeMM().GetHeight();
-#endif
- // FIXME_MGL -- not in wxUniversal branch (and not implementend anyway,
- // hardcode it for 75dpi for now)
- m_mm_to_pix_x = ((double)wxGetDisplaySize().GetWidth() / 75) * inches2mm;
- m_mm_to_pix_y = ((double)wxGetDisplaySize().GetHeight() / 75) * inches2mm;
m_pen = *wxBLACK_PEN;
m_font = *wxNORMAL_FONT;
m_MGLDC = mgldc;
m_OwnsMGLDC = OwnsMGLDC;
m_ok = TRUE;
+
+ if ( mgldc->getDC()->a.clipRegion )
+ {
+ MGLRegion clip;
+ mgldc->getClipRegion(clip);
+ m_globalClippingRegion = wxRegion(clip);
+ // FIXME_MGL -- reuse wxWindows::m_updateRegion ?
+ m_currentClippingRegion = m_globalClippingRegion;
+ m_clipping = TRUE;
+ }
+
InitializeMGLDC();
}
{
wxCHECK_RET( Ok(), wxT("invalid dc") );
- if ( region.Empty() )
+ if ( region.IsEmpty() )
{
DestroyClippingRegion();
return;
{
wxCHECK_RET( Ok(), wxT("invalid dc") );
- m_MGLDC->setClipRect(MGLRect(0, 0, m_MGLDC->sizex(), m_MGLDC->sizey()));
- m_clipping = FALSE;
- m_currentClippingRegion.Clear();
+ if ( !m_globalClippingRegion.IsNull() )
+ {
+ m_MGLDC->setClipRegion(m_globalClippingRegion.GetMGLRegion());
+ m_currentClippingRegion = m_globalClippingRegion;
+ m_clipping = TRUE;
+ }
+ else
+ {
+ m_MGLDC->setClipRect(MGLRect(0, 0, m_MGLDC->sizex(), m_MGLDC->sizey()));
+ m_clipping = FALSE;
+ m_currentClippingRegion.Clear();
+ }
}
// ---------------------------------------------------------------------------
wxCHECK_RET( Ok(), wxT("invalid dc") );
m_MGLDC->makeCurrent(); // will go away with MGL6.0
- m_MGLDC->clearDevice();
- if ( m_backgroundBrush.GetStyle() != wxSOLID &&
- m_backgroundBrush.GetStyle() != wxTRANSPARENT )
+ if ( m_backgroundBrush.GetStyle() != wxTRANSPARENT )
{
int w, h;
wxBrush oldb = m_brush;
void wxDC::DoDrawText(const wxString& text, wxCoord x, wxCoord y)
{
- if ( m_pen.GetStyle() == wxTRANSPARENT ) return;
m_MGLDC->makeCurrent(); // will go away with MGL6.0
DrawAnyText(text, x, y);
if ( m_font.GetUnderlined() )
{
int x1 = xx, y1 = yy;
- int x2, y2;
+ int x2 = 0 , y2 = 0;
int w = m_MGLDC->textWidth(c_text);
m_MGLDC->underScoreLocation(x1, y1, c_text);
switch (m_MGLDC->getTextDirection())
wxCoord x, wxCoord y,
double angle)
{
- if ( m_pen.GetStyle() == wxTRANSPARENT ) return;
m_MGLDC->makeCurrent(); // will go away with MGL6.0
if ( angle == 0 )
*descent = YDEV2LOGREL(m_mglFont->descent);
if ( externalLeading )
*externalLeading = YDEV2LOGREL(m_mglFont->leading);
-
+
if ( theFont != NULL )
wxConstCast(this, wxDC)->SetFont(oldFont);
}
xsrc = source->LogicalToDeviceX(xsrc);
ysrc = source->LogicalToDeviceY(ysrc);
- /* TODO: use the mask origin when drawing transparently */
+ /* FIXME_MGL: use the mask origin when drawing transparently */
if (xsrcMask == -1 && ysrcMask == -1)
{
xsrcMask = xsrc; ysrcMask = ysrc;