#include "wx/log.h"
#include <string.h>
-#if defined(__WXMSW__) && !defined(__PALMOS__)
+#if defined(__WXMSW__)
#include "wx/msw/wrapwin.h"
#endif
wxRect& wxRect::Union(const wxRect& rect)
{
- // ignore empty rectangles
- if ( rect.width && rect.height )
+ // ignore empty rectangles: union with an empty rectangle shouldn't extend
+ // this one to (0, 0)
+ if ( !width || !height )
+ {
+ *this = rect;
+ }
+ else if ( rect.width && rect.height )
{
int x1 = wxMin(x, rect.x);
int y1 = wxMin(y, rect.y);
width = x2 - x1;
height = y2 - y1;
}
+ //else: we're not empty and rect is empty
return *this;
}
}
else // new colour
{
- (*m_map)[name] = new wxColour(colour);
+ (*m_map)[colName] = new wxColour(colour);
}
}