openframeworks / openframeworks/openFrameworks
ofGetMousePreviousX/Y() not actually previous in event callbacks.
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 10.4k
- Forks
- 2.6k
- Avg merge
- 1d 21h
- Merged PRs (30d)
- 9
Description
e.g.
void ofApp::mousePressed(int x, int y, int button)
{
cout << x << " / " << y << endl;
cout << ofGetPreviousMouseX() << " / " << ofGetPreviousMouseY() << endl;
cout << "--" << endl;
}
They print out the same thing.
I'm not sure if this is a bug or not, but it was definitely unexpected.
A solution would be to make sure that our setting our previous mouse calls are called after the mouse events are dispatched.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the ofGetPreviousMouseX() and ofGetPreviousMouseY() entry points and reproduce the issue from an ofApp::mousePressed callback using the example shown. Trace when previous mouse coordinates are updated relative to mouse event dispatch; done means the callback can observe the prior coordinates rather than the current ones.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- desktop
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100