Skip to content

Commit

Permalink
no longer tries to draw with 0 width/height
Browse files Browse the repository at this point in the history
  • Loading branch information
notsecure committed Mar 24, 2014
1 parent ce2ae04 commit b968426
Showing 1 changed file with 22 additions and 20 deletions.
42 changes: 22 additions & 20 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -837,33 +837,35 @@ LRESULT CALLBACK WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
w = GET_X_LPARAM(lParam);
h = GET_Y_LPARAM(lParam);

width = w;
height = h;

int x2 = (MAIN_X + 32 + 600) < (width - 24) ? MAIN_X + 32 + 600 : width - 24;
if(w != 0)
{
width = w;
height = h;

edit_name.right = x2;
edit_status.right = x2;
int x2 = (MAIN_X + 32 + 600) < (width - 24) ? MAIN_X + 32 + 600 : width - 24;

edit_addid.right = x2;
edit_addmsg.right = x2;
edit_name.right = x2;
edit_status.right = x2;

button_addfriend.x = edit_addmsg.right - 50;
button_addfriend.y = MAIN_Y + 222;
edit_addid.right = x2;
edit_addmsg.right = x2;

edit_msg.y = height - 128;
edit_msg.bottom = edit_msg.y + 80;
edit_msg.right = width - 24;
button_addfriend.x = edit_addmsg.right - 50;
button_addfriend.y = MAIN_Y + 222;

if(hdc_bm)
{
DeleteObject(hdc_bm);
}
edit_msg.y = height - 128;
edit_msg.bottom = edit_msg.y + 80;
edit_msg.right = width - 24;

hdc_bm = CreateCompatibleBitmap(main_hdc, width, height);
SelectObject(hdc, hdc_bm);
if(hdc_bm)
{
DeleteObject(hdc_bm);
}

drawall();
hdc_bm = CreateCompatibleBitmap(main_hdc, width, height);
SelectObject(hdc, hdc_bm);
drawall();
}
//commitdraw(0, 0, width, height);

break;
Expand Down

0 comments on commit b968426

Please sign in to comment.