Commit ea33dc2c authored by Leon's avatar Leon

Les overrides de couleur et de police sont appliqués avant ceux de karaoké.

Les effets karaoké sont calculés sur la feuille de style actuelle. Si des changements de style sont précisés dans la même balise mais après, ils ne seront donc pas pris en compte.
parent 22e14fec
......@@ -1504,16 +1504,30 @@ let SubtitleManager = (function() {
function overrideToCSS(override_block,tspan_data) {
tspan_data.karaokeType = "";
let match, overreg = /\\(t(?!e)[^\\]*(?:\\[^t][^\\]*)*|[^\\]*)/g;
while (match = overreg.exec(override_block)) {
function _callMap(match) {
let opt = match[1];
let i = compiled_trie(opt);
if (i) {
let override = map[opt.slice(0,i)];
let override = map[opt.slice(0, i)];
override.call(this, opt.slice(i), tspan_data);
}
}
let match, overreg = /\\(t(?!e)[^\\]*(?:\\[^t][^\\]*)*|[^\\]*)/g;
const karaokeregex = /^k|^_k/;
let last_but_not_least;
while (match = overreg.exec(override_block)) {
if (karaokeregex.test(match[1])) {
last_but_not_least = match;
continue;
}
// If the karaoke is processed after the fad effect, it isn't processed at the end :thinking:
if (typeof last_but_not_least === 'object' && match[1].slice(0,3) === 'fad') _callMap.call(this, last_but_not_least);
_callMap.call(this, match);
}
// The karaoke override is processed at the end to make sure that the colors and the font overrides are processed
if (last_but_not_least) _callMap.call(this, last_but_not_least);
let s = this.style;
let stroke_alpha = tspan_data.karaokeType == "ko" ? 0 : s.c3a;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment