Добавил настройки для изображений, добаил автоматический ресайз

This commit is contained in:
Book Pauk
2019-02-20 17:17:51 +07:00
parent 83fc586e03
commit 55d02495a3
5 changed files with 41 additions and 9 deletions

View File

@@ -532,7 +532,7 @@ export default class BookParser {
last: Boolean,
parts: array of {
style: {bold: Boolean, italic: Boolean, center: Boolean},
image: {local: Boolean, inline: Boolean, id: String, imageLine: Number, lineCount: Number, resize: Boolean, paraIndex: Number},
image: {local: Boolean, inline: Boolean, id: String, imageLine: Number, lineCount: Number, paraIndex: Number},
text: String,
}
}*/
@@ -553,6 +553,7 @@ export default class BookParser {
//изображения
if (part.image.id && !part.image.inline) {
parsed.visible = this.showImages;
const bin = this.binary[part.image.id];
let lineCount = this.imageHeightLines;
@@ -569,7 +570,6 @@ export default class BookParser {
id: part.image.id,
imageLine: i,
lineCount,
resize: (c > lineCount),
paraIndex
}});
lines.push(line);
@@ -580,7 +580,7 @@ export default class BookParser {
line.first = (j == 0);
line.last = true;
line.parts.push({style, text: ' ',
image: {local: part.image.local, inline: false, id: part.image.id, imageLine: i, lineCount, resize: (c > lineCount), paraIndex}});
image: {local: part.image.local, inline: false, id: part.image.id, imageLine: i, lineCount, paraIndex}});
continue;
}