Skip to content

Commit 4c5f273

Browse files
committed
Update SVGSerialize to use three-digit zero-padding for frame numbers in generated SVG filenames for improved lexicographic sorting.
Two digits turned out to be too conservative. For example, the solution to the SlidingPuzzle.tla of the TLA+ examples is longer. Signed-off-by: Markus Alexander Kuppe <[email protected]>
1 parent 90911bf commit 4c5f273

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

modules/SVG.tla

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -230,16 +230,16 @@ PointOnLine(from, to, segment) ==
230230
(* SVGSerialize(SVGDoc(myElements, 0, 0, 800, 600, <<>>), *)
231231
(* "svg_frame_", TLCGet("level")) *)
232232
(* *)
233-
(* This creates files like: svg_frame_01.svg, *)
234-
(* svg_frame_02.svg, etc. *)
233+
(* This creates files like: svg_frame_001.svg, *)
234+
(* svg_frame_002.svg, etc. *)
235235
(**************************************************************************)
236236
SVGSerialize(svg, frameNamePrefix, frameNumber) ==
237237
LET IO == INSTANCE IOUtils IN
238238
IO!Serialize(
239239
SVGElemToString(svg),
240240
\* Construct the filename using the prefix and a zero-padded frame
241241
\* number so that files sort correctly lexicographically.
242-
frameNamePrefix \o IO!zeroPadN(frameNumber, 2) \o ".svg",
242+
frameNamePrefix \o IO!zeroPadN(frameNumber, 3) \o ".svg",
243243
[format |-> "TXT", charset |-> "UTF-8",
244244
openOptions |-> <<"WRITE", "CREATE", "TRUNCATE_EXISTING">>])
245245

0 commit comments

Comments
 (0)