//-----------------------------------------------------------------------------
#define RAD2DEG 57.2957795131
+
// Fudge factor. Obsolete?
-#define WX_GC_CF 0
+ // No. Robert Roebling
+#define WX_GC_CF 1
//-----------------------------------------------------------------------------
// wxWindowDC
};
void wxWindowDC::FloodFill( long WXUNUSED(x1), long WXUNUSED(y1),
- wxColour* WXUNUSED(col), int WXUNUSED(style) )
+ const wxColour& WXUNUSED(col), int WXUNUSED(style) )
{
// TODO
};
XDestroyImage(image);
}
-void wxWindowDC::DrawIcon( const wxIcon &icon, long x, long y, bool useMask )
+void wxWindowDC::DrawIcon( const wxIcon &icon, long x, long y)
{
if (!Ok()) return;
if (!icon.Ok()) return;
-
+
+ DrawBitmap(icon, x, y, TRUE);
+
+#if 0
// FreeGetPixelCache();
// Be sure that foreground pixels (1) of
(int) XLOG2DEV (x), (int) YLOG2DEV (y), FALSE, &cache);
}
CalcBoundingBox (x, y);
-
+#endif
};
bool wxWindowDC::Blit( long xdest, long ydest, long width, long height,
if (!theFont->Ok())
{
// TODO: this should be an error log function
- cerr << "wxWindows warning - set a valid font before calling GetTextExtent!\n";
+ wxFAIL_MSG("set a valid font before calling GetTextExtent!");
+
*width = -1;
*height = -1;
return;
int w, h;
if (m_window)
{
- // TODO: should we get the virtual size?
m_window->GetSize(&w, &h);
if (m_window && m_window->GetBackingPixmap())
m_brush = saveBrush;
};
+void wxWindowDC::Clear(const wxRect& rect)
+{
+ if (!Ok()) return;
+
+ int x = rect.x; int y = rect.y;
+ int w = rect.width; int h = rect.height;
+
+ wxBrush saveBrush = m_brush;
+ SetBrush (m_backgroundBrush);
+
+ XFillRectangle ((Display*) m_display, (Pixmap) m_pixmap, (GC) m_gc, x, y, w, h);
+
+ if (m_window && m_window->GetBackingPixmap())
+ XFillRectangle ((Display*) m_display, (Pixmap) m_window->GetBackingPixmap(),(GC) m_gcBacking, x, y, w, h);
+
+ m_brush = saveBrush;
+};
+
void wxWindowDC::SetFont( const wxFont &font )
{
if (!Ok()) return;
m_currentPenDash = m_pen.GetDash();
if (m_currentStyle == wxSTIPPLE)
- m_currentStipple = m_pen.GetStipple ();
+ m_currentStipple = * m_pen.GetStipple ();
bool sameStyle = (oldStyle == m_currentStyle &&
oldFill == m_currentFill &&
break;
case wxCAP_ROUND:
default:
- cap = CapRound;
+ cap = (scaled_width <= 1) ? CapNotLast : CapRound;
break;
}
{
Pixmap myStipple;
- oldStipple = (wxBitmap*) NULL; // For later reset!!
+ oldStipple = wxNullBitmap; // For later reset!!
switch (m_currentFill)
{
m_currentFill = m_brush.GetStyle ();
if (m_currentFill == wxSTIPPLE)
- m_currentStipple = m_brush.GetStipple ();
+ m_currentStipple = * m_brush.GetStipple ();
wxColour oldBrushColour(m_currentColour);
m_currentColour = m_brush.GetColour ();