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

Miscellaneous bugfixes #186

Open
wants to merge 26 commits into
base: master
Choose a base branch
from
Open

Miscellaneous bugfixes #186

wants to merge 26 commits into from

Conversation

arch1t3cht
Copy link
Collaborator

Various bugfixes that accumulated at arch1t3cht/Aegisub. This one is a bit more involved but can again be checked commit for commit.

arch1t3cht and others added 26 commits December 3, 2023 22:23
Float edits with a spinner are sized to fit their full min-max range
of possible values, so after wx stopped displaying large values in
scientific notation, many float edits would be drawn far too wide.
This commit makes min and max default to 0 and 100 (matching wx's
defaults) instead of -DOUBLE_MAX and DOUBLE_MAX.

Note that this does change the behavior of lua dialogs, but does not
contradict existing documentation or specification. It should only
affect scripts who either disobey the specification by specifying only
one value out of max/min, or scripts displaying these large float edits
by specifing a step, but no max or min.
These were giving false negatives on samba shares, which broke the font
collector. Windows also recommends to not use access checks in these
cases, and instead just see if the operations succeeds or not.
These alignment flags would cause an assertion error
"Horizontal alignment flags are ignored in horizontal sizers"
when opening the dialog (mainly when importing styles from another
script).
As the assertion error says, the flags are ignored anyway, so they're
safe to remove.
When cancelling an automation macro from the progress dialog, the dialog
throws a UserCancelException. If the macro still runs to the end
afterwards (instead of calling aegisub.cancel or causing an exception),
the two return values are left on the stack. This causes assertion errors
due to check_stack when those are enabled.
The new formula is just the inverse function of the CFR part of
the TimeAtFrame function.

To see how the previous implementation was faulty, see either the added
tests, or
- In Aegisub, open a dummy video with a frame rate of 23.976
- Make a subtitle event with start time 04:44.41
- Double-click the line to (supposedly) seek to its first frame
- This will seek one frame earlier than it should, and the event will
  not be displayed on the resulting frame.
The percent values used for the overscan masks follow the BBC's
guidelines, as in
https://en.wikipedia.org/wiki/Overscan#Overscan_amounts .
However, these measure the per-side width as opposed to the total
percentage of width/height being cut off. Thus, they should not be
divided by two when drawing the mask.
This fixes a crash on Windows when double-clicking the draggable
separator between the column headers "Command" and "Description" in the
hotkey configuration dialog.
... ever wondered why you can't drag .webm files into Aegisub?
This is why.
It should not be in alt-dragging mode by default.

Fix #32
wx doesn't seem to like the dialogs being created on some other worker
thread, which makes file dialogs opened by lua scripts crash in various
ways on Linux. Doing everything on the main thread hopefully fixes this.

Fixes #51 .
Previously different menus may use conflict ids in range 10000~.

Fix #53
See also Aegisub#131
These commands were revamped in 0ef9963 but the default hotkeys were
never updated. The hotkeys were automatically migrated, but resetting
the settings back to defaults would still set invalid settings.
msg can be nil, which would previously error out when trying to print it.
IsConversionSupported unconditionally calls iconv_close on the
descriptor returned by iconv_open. This may result in crashes if
iconv_open returns iconv_invalid.
This would cause an assertion failure in functions like lua_for_each
when the given closure throws an error and thus leaves some  values on
the stack. This can make Aegisub crash entirely instead of just catching
and reporting the error. Instead, these stack_checks can be done
manually.
* Use icon size in the config
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants