1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-20 15:18:08 +02:00

Text alignment inside input controls

This commit is contained in:
notmasteryet 2011-11-02 22:00:33 -05:00
parent f3ee85efab
commit 3d36a05d7f
2 changed files with 13 additions and 1 deletions

View file

@ -398,7 +398,18 @@ var PageView = function pageView(container, content, id, pageWidth, pageHeight,
function assignFontStyle(element, item) {
var fontStyles = '';
if ('fontSize' in item)
fontStyles += 'font-size: ' + Math.round(item.fontSize * scale) + 'px';
fontStyles += 'font-size: ' + Math.round(item.fontSize * scale) + 'px;';
switch (item.textAlignment) {
case 0:
fontStyles += 'text-align: left;';
break;
case 1:
fontStyles += 'text-align: center;';
break;
case 2:
fontStyles += 'text-align: right;';
break;
}
element.setAttribute('style', element.getAttribute('style') + fontStyles);
}