Эх сурвалжийг харах

Переименование

Book Pauk 6 жил өмнө
parent
commit
d56ece5d3a

+ 3 - 3
client/components/Reader/TextPage/TextPage.vue

@@ -142,8 +142,8 @@ class TextPage extends Vue {
             {
             {
                 begin: Number,
                 begin: Number,
                 end: Number,
                 end: Number,
-                paraBegin: Boolean,
-                paraEnd: Boolean,
+                first: Boolean,
+                last: Boolean,
                 parts: array of {
                 parts: array of {
                     style: 'bold'|'italic',
                     style: 'bold'|'italic',
                     text: String,
                     text: String,
@@ -157,7 +157,7 @@ class TextPage extends Vue {
 
 
             y += this.lineHeight;
             y += this.lineHeight;
             let filled = false;
             let filled = false;
-            if (this.textAlignJustify && !line.paraEnd) {
+            if (this.textAlignJustify && !line.last) {
                 const words = text.split(' ');
                 const words = text.split(' ');
                 if (words.length > 1) {
                 if (words.length > 1) {
                     let space = canvas.width - line.width + spaceWidth*(words.length - 1);
                     let space = canvas.width - line.width + spaceWidth*(words.length - 1);

+ 6 - 6
client/components/Reader/share/BookParser.js

@@ -253,8 +253,8 @@ export default class BookParser {
         {
         {
             begin: Number,
             begin: Number,
             end: Number,
             end: Number,
-            paraBegin: Boolean,
-            paraEnd: Boolean,
+            first: Boolean,
+            last: Boolean,
             parts: array of {
             parts: array of {
                 style: 'bold'|'italic',
                 style: 'bold'|'italic',
                 text: String,
                 text: String,
@@ -279,8 +279,8 @@ export default class BookParser {
                 line.parts.push({style: '', text: prevPart});
                 line.parts.push({style: '', text: prevPart});
                 line.end = line.begin + prevPart.length;//нет -1 !!!
                 line.end = line.begin + prevPart.length;//нет -1 !!!
                 line.width = prevW;
                 line.width = prevW;
-                line.paraBegin = (k == 0);
-                line.paraEnd = false;
+                line.first = (k == 0);
+                line.last = false;
                 lines.push(line);
                 lines.push(line);
 
 
                 line = {begin: line.end + 1, parts: []};
                 line = {begin: line.end + 1, parts: []};
@@ -295,8 +295,8 @@ export default class BookParser {
         line.parts.push({style: '', text: prevPart});
         line.parts.push({style: '', text: prevPart});
         line.end = line.begin + prevPart.length - 1;
         line.end = line.begin + prevPart.length - 1;
         line.width = prevW;
         line.width = prevW;
-        line.paraBegin = (k == 0);
-        line.paraEnd = true;
+        line.first = (k == 0);
+        line.last = true;
         lines.push(line);
         lines.push(line);
 
 
         parsed.lines = lines;
         parsed.lines = lines;