Skip to content

Commit 174cbb0

Browse files
committed
0.1.14
1 parent d4d7cc1 commit 174cbb0

File tree

5 files changed

+13
-5
lines changed

5 files changed

+13
-5
lines changed

dist/ass-compiler.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -728,6 +728,7 @@
728728
var end = ref.end;
729729

730730
var alignment;
731+
var q = { q: styles[style].tag.q };
731732
var pos;
732733
var org;
733734
var move;
@@ -754,6 +755,7 @@
754755
for (var j$1 = 0; j$1 < tags.length; j$1++) {
755756
var tag$1 = tags[j$1];
756757
alignment = alignment || a2an[tag$1.a || 0] || tag$1.an;
758+
q = compileTag(tag$1, 'q') || q;
757759
pos = pos || compileTag(tag$1, 'pos');
758760
org = org || compileTag(tag$1, 'org');
759761
move = move || compileTag(tag$1, 'move');
@@ -793,7 +795,7 @@
793795
}
794796
slices.push(slice);
795797

796-
return Object.assign({ alignment: alignment, slices: slices }, pos, org, move, fade, clip);
798+
return Object.assign({ alignment: alignment, slices: slices }, q, pos, org, move, fade, clip);
797799
}
798800

799801
function compileDialogues(ref) {
@@ -949,6 +951,7 @@
949951
xshad: s.Shadow,
950952
yshad: s.Shadow,
951953
fe: s.Encoding,
954+
// TODO: [breaking change] remove `q` from style
952955
q: /^[0-3]$/.test(info.WrapStyle) ? info.WrapStyle * 1 : 2,
953956
};
954957
result[s.Name] = { style: s, tag: tag };
@@ -971,6 +974,7 @@
971974
info: tree.info,
972975
width: tree.info.PlayResX * 1 || null,
973976
height: tree.info.PlayResY * 1 || null,
977+
wrapStyle: /^[0-3]$/.test(tree.info.WrapStyle) ? tree.info.WrapStyle * 1 : 2,
974978
collisions: tree.info.Collisions || 'Normal',
975979
styles: styles,
976980
dialogues: compileDialogues({

dist/ass-compiler.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/esm/ass-compiler.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -722,6 +722,7 @@ function compileText(ref) {
722722
var end = ref.end;
723723

724724
var alignment;
725+
var q = { q: styles[style].tag.q };
725726
var pos;
726727
var org;
727728
var move;
@@ -748,6 +749,7 @@ function compileText(ref) {
748749
for (var j$1 = 0; j$1 < tags.length; j$1++) {
749750
var tag$1 = tags[j$1];
750751
alignment = alignment || a2an[tag$1.a || 0] || tag$1.an;
752+
q = compileTag(tag$1, 'q') || q;
751753
pos = pos || compileTag(tag$1, 'pos');
752754
org = org || compileTag(tag$1, 'org');
753755
move = move || compileTag(tag$1, 'move');
@@ -787,7 +789,7 @@ function compileText(ref) {
787789
}
788790
slices.push(slice);
789791

790-
return Object.assign({ alignment: alignment, slices: slices }, pos, org, move, fade, clip);
792+
return Object.assign({ alignment: alignment, slices: slices }, q, pos, org, move, fade, clip);
791793
}
792794

793795
function compileDialogues(ref) {
@@ -943,6 +945,7 @@ function compileStyles(ref) {
943945
xshad: s.Shadow,
944946
yshad: s.Shadow,
945947
fe: s.Encoding,
948+
// TODO: [breaking change] remove `q` from style
946949
q: /^[0-3]$/.test(info.WrapStyle) ? info.WrapStyle * 1 : 2,
947950
};
948951
result[s.Name] = { style: s, tag: tag };
@@ -965,6 +968,7 @@ function compile(text, options) {
965968
info: tree.info,
966969
width: tree.info.PlayResX * 1 || null,
967970
height: tree.info.PlayResY * 1 || null,
971+
wrapStyle: /^[0-3]$/.test(tree.info.WrapStyle) ? tree.info.WrapStyle * 1 : 2,
968972
collisions: tree.info.Collisions || 'Normal',
969973
styles: styles,
970974
dialogues: compileDialogues({

0 commit comments

Comments
 (0)