forked from openlp/openlp
Fix problem with the outline alignment when the theme is using Justify.
bzr-revno: 1829 Fixes: https://launchpad.net/bugs/859950
This commit is contained in:
commit
4949f88f28
@ -129,9 +129,27 @@ sup {
|
|||||||
var match = /-webkit-text-fill-color:[^;\"]+/gi;
|
var match = /-webkit-text-fill-color:[^;\"]+/gi;
|
||||||
if(timer != null)
|
if(timer != null)
|
||||||
clearTimeout(timer);
|
clearTimeout(timer);
|
||||||
|
/*
|
||||||
|
QtWebkit bug with outlines and justify causing outline alignment
|
||||||
|
problems. (Bug 859950) Surround each word with a <span> to workaround,
|
||||||
|
but only in this scenario.
|
||||||
|
*/
|
||||||
|
var txt = document.getElementById('lyricsmain');
|
||||||
|
if(window.getComputedStyle(txt).textAlign == 'justify'){
|
||||||
|
var outline = document.getElementById('lyricsoutline');
|
||||||
|
if(outline != null)
|
||||||
|
txt = outline;
|
||||||
|
if(window.getComputedStyle(txt).webkitTextStrokeWidth != '0px'){
|
||||||
|
newtext = newtext.replace(/(\s| )+(?![^<]*>)/g,
|
||||||
|
function(match) {
|
||||||
|
return '</span>' + match + '<span>';
|
||||||
|
});
|
||||||
|
newtext = '<span>' + newtext + '</span>';
|
||||||
|
}
|
||||||
|
}
|
||||||
text_fade('lyricsmain', newtext);
|
text_fade('lyricsmain', newtext);
|
||||||
text_fade('lyricsoutline', newtext);
|
text_fade('lyricsoutline', newtext);
|
||||||
text_fade('lyricsshadow', newtext.replace(match, ""));
|
text_fade('lyricsshadow', newtext.replace(match, ''));
|
||||||
if(text_opacity() == 1) return;
|
if(text_opacity() == 1) return;
|
||||||
timer = setTimeout(function(){
|
timer = setTimeout(function(){
|
||||||
show_text(newtext);
|
show_text(newtext);
|
||||||
|
Loading…
Reference in New Issue
Block a user