Поправки багов

This commit is contained in:
Book Pauk
2019-01-16 15:47:27 +07:00
parent de0eca3097
commit c49abaf8e5
2 changed files with 14 additions and 11 deletions

View File

@@ -130,21 +130,25 @@ class TextPage extends Vue {
} }
pageDown() { pageDown() {
if (this.linesDown) {
let i = this.pageLineCount; let i = this.pageLineCount;
i--; i--;
if (this.linesDown && this.linesDown.length > i) { if (i >= 0 && this.linesDown.length > i) {
this.bookPos = this.linesDown[i].begin; this.bookPos = this.linesDown[i].begin;
} }
} }
}
pageUp() { pageUp() {
if (this.linesUp) {
let i = this.pageLineCount; let i = this.pageLineCount;
i--; i--;
i = (i > this.linesUp.length - 1 ? this.linesUp.length - 1 : i); i = (i > this.linesUp.length - 1 ? this.linesUp.length - 1 : i);
if (this.linesUp && this.linesUp.length > i) { if (i >= 0 && this.linesUp.length > i) {
this.bookPos = this.linesUp[i].begin; this.bookPos = this.linesUp[i].begin;
} }
} }
}
keyHook(event) { keyHook(event) {
if (event.type == 'keydown') { if (event.type == 'keydown') {

View File

@@ -6,8 +6,7 @@ export default class BookParser {
// defaults // defaults
this.p = 30;// px, отступ параграфа this.p = 30;// px, отступ параграфа
this.w = 300;// px, ширина страницы this.w = 300;// px, ширина страницы
this.textAlignJustify = false;// выравнивание по ширине this.wordWrap = false;// перенос по слогам
this.wordWrap = false;// перенос по слогам, если textAlignJustify = true
// заглушка // заглушка
this.measureText = (text, style) => {// eslint-disable-line no-unused-vars this.measureText = (text, style) => {// eslint-disable-line no-unused-vars