You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(present): fix presentation size and add screen option (#232)
* feat(present): fix presentation size and add screen option
This kinda fixes the issue of weird resizes between two presentations
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* fix(ci): typing
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
help="Start presenting at a given animation number (0 is first, -1 is last). This conflicts with slide number since animation number is absolute to the presentation.",
1000
1019
)
1020
+
@click.option(
1021
+
"--screen",
1022
+
"screen_number",
1023
+
metavar="NUMBER",
1024
+
type=int,
1025
+
default=None,
1026
+
help="Presents content on the given screen (a.k.a. display).",
1027
+
)
1001
1028
@click.help_option("-h", "--help")
1002
1029
@verbosity_option
1003
1030
defpresent(
@@ -1018,6 +1045,7 @@ def present(
1018
1045
start_at_scene_number: Optional[int],
1019
1046
start_at_slide_number: Optional[int],
1020
1047
start_at_animation_number: Optional[int],
1048
+
screen_number: Optional[int] =None,
1021
1049
) ->None:
1022
1050
"""
1023
1051
Present SCENE(s), one at a time, in order.
@@ -1069,7 +1097,9 @@ def present(
1069
1097
ext=record_to.suffix
1070
1098
ifext.lower() !=".avi":
1071
1099
raiseclick.UsageError(
1072
-
"Recording only support '.avi' extension. For other video formats, please convert the resulting '.avi' file afterwards."
1100
+
"Recording only support '.avi' extension. "
1101
+
"For other video formats, "
1102
+
"please convert the resulting '.avi' file afterwards."
1073
1103
)
1074
1104
1075
1105
ifstart_at[0]:
@@ -1087,6 +1117,19 @@ def present(
1087
1117
app=QApplication.instance()
1088
1118
1089
1119
app.setApplicationName("Manim Slides")
1120
+
1121
+
ifscreen_numberisnotNone:
1122
+
try:
1123
+
screen=app.screens()[screen_number]
1124
+
exceptIndexError:
1125
+
logger.error(
1126
+
f"Invalid screen number {screen_number}, "
1127
+
f"allowed values are from 0 to {len(app.screens())-1} (incl.)"
0 commit comments