Closed totalgee closed 3 years ago
Note that there are some other calls to toPixels()
in the Cinder ImGui code, e.g. in the various mouse and keyboard Event handlers. These seem to work fine (so I didn't change them, though they could easily be fixed by using event->getWindow()->toPixels()
). Presumably the current window is correct in these callbacks, since you're directly interacting with them... (let me know if you want me to change these, too, I initially opted for the minimum fix that corrected my issue ;-) This also seems to be the case with the resize handler, although there we have no direct way to get the window, but it could easily be "fixed" by binding the window in the signal handler, similar to what is done for the update signal handler. Again, let me know if you want that change to be made.
Nice find, this fix makes sense to me.
I think if it makes sense to you for these other winder->toPixel changes to happen it would be more robust and can review it, though for now happy to merge this.
I think if it makes sense to you for these other winder->toPixel changes to happen it would be more robust and can review it, though for now happy to merge this.
Okay, I decided to make these changes, since I was in the code, and if I don't do it now I'll forget about it. See #2243 (this one can stay closed). Thanks!
toPixels()
were using the defaultApp
version (which uses the "current" Window to do the conversion), but the current Window is indeterministic when in anupdate
handler, so with multiple windows, it is likely to reference the wrong one.