Добавил параметр textVertShift в настройки
This commit is contained in:
@@ -65,7 +65,7 @@
|
||||
<template slot="content">
|
||||
Сдвиг шрифта по вертикали в процентах от размера.<br>
|
||||
Отрицательное значение сдвигает вверх, положительное -<br>
|
||||
вниз
|
||||
вниз. Значение зависит от метрики шрифта.
|
||||
</template>
|
||||
<el-input-number v-model="vertShift" :min="-100" :max="100"></el-input-number>
|
||||
</el-tooltip>
|
||||
@@ -111,6 +111,16 @@
|
||||
</el-tooltip>
|
||||
</el-col>
|
||||
</el-form-item>
|
||||
<el-form-item label="Сдвиг">
|
||||
<el-tooltip :open-delay="500" effect="light">
|
||||
<template slot="content">
|
||||
Сдвиг текста по вертикали в процентах от размера шрифта.<br>
|
||||
Отрицательное значение сдвигает вверх, положительное -<br>
|
||||
вниз. Менять, как правило, не требуется.
|
||||
</template>
|
||||
<el-input-number v-model="textVertShift" :min="-100" :max="100"></el-input-number>
|
||||
</el-tooltip>
|
||||
</el-form-item>
|
||||
<el-form-item label="Выравнивание">
|
||||
<el-checkbox v-model="textAlignJustify">По ширине</el-checkbox>
|
||||
<el-checkbox v-model="wordWrap">Перенос по слогам</el-checkbox>
|
||||
|
||||
@@ -170,6 +170,7 @@ class TextPage extends Vue {
|
||||
this.currentTransition = '';
|
||||
this.pageChangeDirectionDown = true;
|
||||
this.fontShift = this.fontVertShift/100;
|
||||
this.textShift = this.textVertShift/100 + this.fontShift;
|
||||
|
||||
//drawHelper
|
||||
this.drawHelper.realWidth = this.realWidth;
|
||||
@@ -430,7 +431,7 @@ class TextPage extends Vue {
|
||||
|
||||
const spaceWidth = this.measureText(' ', {});
|
||||
|
||||
let y = this.indentTB + (this.h - this.pageLineCount*this.lineHeight + this.lineInterval)/2 + this.fontSize*this.fontShift;
|
||||
let y = this.indentTB + (this.h - this.pageLineCount*this.lineHeight + this.lineInterval)/2 + this.fontSize*this.textShift;
|
||||
if (this.showStatusBar)
|
||||
y += this.statusBarHeight*(this.statusBarTop ? 1 : 0);
|
||||
|
||||
|
||||
@@ -27,6 +27,7 @@ const settingDefaults = {
|
||||
fontName: 'ReaderDefault',
|
||||
webFontName: '',
|
||||
fontVertShift: 0,
|
||||
textVertShift: -20,
|
||||
|
||||
lineInterval: 3,// px, межстрочный интервал
|
||||
textAlignJustify: true,// выравнивание по ширине
|
||||
|
||||
Reference in New Issue
Block a user