Skip to content

Commit

Permalink
0.1.14
Browse files Browse the repository at this point in the history
  • Loading branch information
weizhenye committed Aug 11, 2024
1 parent d4d7cc1 commit 174cbb0
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 5 deletions.
6 changes: 5 additions & 1 deletion dist/ass-compiler.js
Original file line number Diff line number Diff line change
Expand Up @@ -728,6 +728,7 @@
var end = ref.end;

var alignment;
var q = { q: styles[style].tag.q };
var pos;
var org;
var move;
Expand All @@ -754,6 +755,7 @@
for (var j$1 = 0; j$1 < tags.length; j$1++) {
var tag$1 = tags[j$1];
alignment = alignment || a2an[tag$1.a || 0] || tag$1.an;
q = compileTag(tag$1, 'q') || q;
pos = pos || compileTag(tag$1, 'pos');
org = org || compileTag(tag$1, 'org');
move = move || compileTag(tag$1, 'move');
Expand Down Expand Up @@ -793,7 +795,7 @@
}
slices.push(slice);

return Object.assign({ alignment: alignment, slices: slices }, pos, org, move, fade, clip);
return Object.assign({ alignment: alignment, slices: slices }, q, pos, org, move, fade, clip);
}

function compileDialogues(ref) {
Expand Down Expand Up @@ -949,6 +951,7 @@
xshad: s.Shadow,
yshad: s.Shadow,
fe: s.Encoding,
// TODO: [breaking change] remove `q` from style
q: /^[0-3]$/.test(info.WrapStyle) ? info.WrapStyle * 1 : 2,
};
result[s.Name] = { style: s, tag: tag };
Expand All @@ -971,6 +974,7 @@
info: tree.info,
width: tree.info.PlayResX * 1 || null,
height: tree.info.PlayResY * 1 || null,
wrapStyle: /^[0-3]$/.test(tree.info.WrapStyle) ? tree.info.WrapStyle * 1 : 2,
collisions: tree.info.Collisions || 'Normal',
styles: styles,
dialogues: compileDialogues({
Expand Down
2 changes: 1 addition & 1 deletion dist/ass-compiler.min.js

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion dist/esm/ass-compiler.js
Original file line number Diff line number Diff line change
Expand Up @@ -722,6 +722,7 @@ function compileText(ref) {
var end = ref.end;

var alignment;
var q = { q: styles[style].tag.q };
var pos;
var org;
var move;
Expand All @@ -748,6 +749,7 @@ function compileText(ref) {
for (var j$1 = 0; j$1 < tags.length; j$1++) {
var tag$1 = tags[j$1];
alignment = alignment || a2an[tag$1.a || 0] || tag$1.an;
q = compileTag(tag$1, 'q') || q;
pos = pos || compileTag(tag$1, 'pos');
org = org || compileTag(tag$1, 'org');
move = move || compileTag(tag$1, 'move');
Expand Down Expand Up @@ -787,7 +789,7 @@ function compileText(ref) {
}
slices.push(slice);

return Object.assign({ alignment: alignment, slices: slices }, pos, org, move, fade, clip);
return Object.assign({ alignment: alignment, slices: slices }, q, pos, org, move, fade, clip);
}

function compileDialogues(ref) {
Expand Down Expand Up @@ -943,6 +945,7 @@ function compileStyles(ref) {
xshad: s.Shadow,
yshad: s.Shadow,
fe: s.Encoding,
// TODO: [breaking change] remove `q` from style
q: /^[0-3]$/.test(info.WrapStyle) ? info.WrapStyle * 1 : 2,
};
result[s.Name] = { style: s, tag: tag };
Expand All @@ -965,6 +968,7 @@ function compile(text, options) {
info: tree.info,
width: tree.info.PlayResX * 1 || null,
height: tree.info.PlayResY * 1 || null,
wrapStyle: /^[0-3]$/.test(tree.info.WrapStyle) ? tree.info.WrapStyle * 1 : 2,
collisions: tree.info.Collisions || 'Normal',
styles: styles,
dialogues: compileDialogues({
Expand Down
Loading

0 comments on commit 174cbb0

Please sign in to comment.