Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drawing in a pictureBox on secondary Lua forms doesn't work #3778

Closed
Deakula opened this issue Sep 21, 2023 · 1 comment
Closed

Drawing in a pictureBox on secondary Lua forms doesn't work #3778

Deakula opened this issue Sep 21, 2023 · 1 comment
Labels

Comments

@Deakula
Copy link

Deakula commented Sep 21, 2023

Summary

When a pictureBox is created with the handle of a form that is NOT the oldest form created in the Lua script, and then an attempt is made to draw on said pictureBox, the drawing is unsuccessful. The "oldest" form being the form that was created before all others with the exception of calling forms.destroy() on the oldest form causing the second-oldest form to take its place and so on.

Repro

  1. Create two or more forms with calls to forms.newform()
  2. Create a pictureBox with forms.pictureBox() for any/all of said forms (at least one of which being a form that is NOT the oldest form created).
  3. Attempt to call any draw method (such as forms.drawLine() or forms.drawText()) for any/all of the pictureBoxes.

Output

For each attempt to draw on a pictureBox that does NOT belong to the oldest form, the following is outputted to the Lua console:

Drawing functions can only be used on PictureBox components.

Host env.

  • BizHawk 2.9.1; Win11 Home 22H2; Intel/NVIDIA

Screenshots

Second Form PictureBox

Second Form PictureBox 2

Second Form PictureBox 3

@YoshiRulz YoshiRulz added re: Lua API/scripting Relating to EmuHawk's Lua API (not the Lua Console) Repro: Affects 2.9.1 labels Sep 21, 2023
@Deakula Deakula changed the title Drawing in a pictureBox on secondary forms doesn't work Drawing in a pictureBox on secondary Lua forms doesn't work Sep 21, 2023
@YoshiRulz
Copy link
Member

I'm guessing no-one (including me) ever tested the linked fix—should be good with 681a576 (though of course I haven't tested that either).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants