Skip to content

Commit 761cf4d

Browse files
committed
Line: shift \kf karaoke tags properly.
Of course there has to be a weird case that behaves differently than all the others.
1 parent c84aff4 commit 761cf4d

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

src/Line.moon

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ frameFromMs = aegisub.frame_from_ms
99
msFromFrame = aegisub.ms_from_frame
1010

1111
class Line
12-
@version: 0x010400
12+
@version: 0x010401
1313
@version_major: bit.rshift( @version, 16 )
1414
@version_minor: bit.band( bit.rshift( @version, 8 ), 0xFF )
1515
@version_patch: bit.band( @version, 0xFF )
@@ -361,11 +361,16 @@ class Line
361361
@runCallbackOnOverrides ( tagBlock ) =>
362362
return tagBlock\gsub karaokeTag.pattern, ( ... ) ->
363363
time = karaokeTag\convert ...
364+
364365
if shift > 0
366+
oldShift = -shift
365367
newTime = time - shift
366368
shift -= time
367369
if newTime > 0
368-
return karaokeTag\format newTime
370+
if karaokeTag.tag == "\\kf"
371+
return karaokeTag\format( oldShift ) .. karaokeTag\format time
372+
else
373+
return karaokeTag\format newTime
369374
else
370375
return ""
371376
else

versions.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"src/ConfigHandler.moon": "0x010102",
33
"src/DataHandler.moon": "0x010002",
44
"src/DataWrapper.moon": "0x010001",
5-
"src/Line.moon": "0x010400",
5+
"src/Line.moon": "0x010401",
66
"src/LineCollection.moon": "0x010100",
77
"src/Log.moon": "0x010000",
88
"src/Math.moon": "0x010000",

0 commit comments

Comments
 (0)