Reputation: 26506
in my code:
void Surface::paintBorders(const Color& color, int borderWidth){
HBRUSH colorBrush = CreateSolidBrush(color.getRGB());
RECT border;
//Top Border:
border.top = 0;
border.bottom = borderWidth;
border.left = 0;
border.right = mRect.right - mRect.left;
FillRect(mHDC, &border, colorBrush);
//Bottom border
border.top = mRect.bottom - mRect.top - borderWidth;
border.bottom = mRect.bottom - mRect.top;
border.left = 0;
border.right = mRect.right - mRect.left;
FillRect(mHDC, &border, colorBrush);
//Right border
border.top = 0;
border.bottom = mRect.bottom - mRect.top;
border.left = mRect.right - mRect.left - borderWidth;
border.right = mRect.right - mRect.left;
FillRect(mHDC, &border, colorBrush);
//Left border
border.top = 0;
border.bottom = mRect.bottom - mRect.top;
border.left = 0;
border.right = borderWidth;
FillRect(mHDC, &border, colorBrush);
DeleteObject(colorBrush);
}
only the top and the left borders are being painted , with the bottom and the right aren't. I quote from MSDN:
This function includes the left and top borders, but excludes the right and bottom borders of the rectangle.
I don't know if it's related or not . I know for sure that all the coordinations are OK, also the HDC and HBRUSH parameters. any ideas?
Upvotes: 0
Views: 432
Reputation: 26506
OK guys, I got the answer , apparently rect was retrieved by GetWindowRect instead GetClientRect which messed up all of the coordinations
Upvotes: 1