1
Window / Possible bug with IsMouseButtonDown(sf::Mouse::Left)
« on: March 11, 2012, 12:03:49 am »
Hi,
I've written a small test program which collects events and draws to the screen only when the left mouse button is down.
The problem occurs with the following sequence of events:
I hold down the left mouse button to start drawing.
I move the mouse cursor outside of the window area.
I release the button.
I move the cursor back into the window area.
Now the screen is still being drawn to even though the mouse button is no longer down.
Code:
I've written a small test program which collects events and draws to the screen only when the left mouse button is down.
The problem occurs with the following sequence of events:
I hold down the left mouse button to start drawing.
I move the mouse cursor outside of the window area.
I release the button.
I move the cursor back into the window area.
Now the screen is still being drawn to even though the mouse button is no longer down.
Code:
Code: [Select]
if (input.IsMouseButtonDown(sf::Mouse::Left))
{
// register action for undo, and save prompt
while (input.IsMouseButtonDown(sf::Mouse::Left))
{
eInst.editActionDraw();
/* get and discard events */
win->Clear();
drawTiles();
drawUI();
win->Display();
}
}