|
117 | 117 | case 'underline':
|
118 | 118 | var start = new ps.Point(event.point);
|
119 | 119 | $rootScope.startRow = getStartRow($rootScope.docInfo, start, attrs);
|
120 |
| - $rootScope.startText = $rootScope.startRow[0].characterCoordinates.filter(x => Math.floor(x) > Math.floor(start.x) |
121 |
| - ) |
122 |
| - ; |
| 120 | + $rootScope.startText = $rootScope.startRow[0].characterCoordinates.filter(function (x) { |
| 121 | + return Math.floor(x) > Math.floor(start.x); |
| 122 | + }); |
123 | 123 | if ($rootScope.startText.length > 1) {
|
124 | 124 | currentObject = new ps.Path.Line(new ps.Point($rootScope.startText[0], $rootScope.startRow[0].lineTop + $rootScope.startRow[0].lineHeight), new ps.Point($rootScope.startText[1], $rootScope.startRow[0].lineTop + $rootScope.startRow[0].lineHeight));
|
125 | 125 | currentObject.strokeColor = 'black';
|
|
134 | 134 | case 'strikeout':
|
135 | 135 | var start = new ps.Point(event.point);
|
136 | 136 | $rootScope.startRow = getStartRow($rootScope.docInfo, start, attrs);
|
137 |
| - $rootScope.startText = $rootScope.startRow[0].characterCoordinates.filter(x => Math.floor(x) > Math.floor(start.x) |
138 |
| - ) |
139 |
| - ; |
| 137 | + $rootScope.startText = $rootScope.startRow[0].characterCoordinates.filter(function (x) { |
| 138 | + return Math.floor(x) > Math.floor(start.x); |
| 139 | + }); |
140 | 140 | if ($rootScope.startText.length > 1) {
|
141 | 141 | currentObject = new ps.Path.Line(new ps.Point($rootScope.startText[0], $rootScope.startRow[0].lineTop + $rootScope.startRow[0].lineHeight / 2), new ps.Point($rootScope.startText[1], $rootScope.startRow[0].lineTop + $rootScope.startRow[0].lineHeight / 2));
|
142 | 142 | currentObject.strokeColor = 'black';
|
|
178 | 178 | case 'underline':
|
179 | 179 | if (currentObject) {
|
180 | 180 | var end = new ps.Point(event.point);
|
181 |
| - var endText = $rootScope.startRow[0].characterCoordinates.filter(x => Math.floor(x) > Math.floor(end.x) |
182 |
| - ) |
183 |
| - ; |
| 181 | + var endText = $rootScope.startRow[0].characterCoordinates.filter(function (x) { |
| 182 | + return Math.floor(x) > Math.floor(end.x); |
| 183 | + }); |
184 | 184 | if (endText.length > 1) {
|
185 | 185 | currentObject.add(new ps.Point(endText[1], $rootScope.startRow[0].lineTop + $rootScope.startRow[0].lineHeight));
|
186 | 186 | }
|
|
192 | 192 | case 'strikeout':
|
193 | 193 | if (currentObject) {
|
194 | 194 | var end = new ps.Point(event.point);
|
195 |
| - var endText = $rootScope.startRow[0].characterCoordinates.filter(x => Math.floor(x) > Math.floor(end.x) |
196 |
| - ) |
197 |
| - ; |
| 195 | + var endText = $rootScope.startRow[0].characterCoordinates.filter(function (x) { |
| 196 | + return Math.floor(x) > Math.floor(end.x); |
| 197 | + }); |
198 | 198 | if (endText.length > 1) {
|
199 | 199 | currentObject.add(new ps.Point(endText[1], $rootScope.startRow[0].lineTop + $rootScope.startRow[0].lineHeight / 2));
|
200 | 200 | }
|
|
483 | 483 | function getStartRow(docInfo, start, attrs) {
|
484 | 484 | var startRow = [];
|
485 | 485 | for (var i = 0; i < 30; i++) {
|
486 |
| - startRow = docInfo.pages[attrs.number].rows.filter(x => Math.floor(x.lineTop) == (Math.floor(start.y) - i ) |
487 |
| - ) |
| 486 | + startRow = docInfo.pages[attrs.number].rows.filter(function (x) { |
| 487 | + Math.floor(x.lineTop) == (Math.floor(start.y) - i ) |
| 488 | + } |
| 489 | + ) |
488 | 490 | ;
|
489 | 491 | if (startRow.length > 0)
|
490 | 492 | return startRow;
|
491 | 493 | }
|
492 | 494 | if (startRow.length == 0)
|
493 | 495 | for (var i = 0; i < 30; i++) {
|
494 |
| - startRow = docInfo.pages[attrs.number].rows.filter(x => Math.floor(x.lineTop) == (Math.floor(start.y) + i ) |
495 |
| - ) |
496 |
| - ; |
| 496 | + startRow = docInfo.pages[attrs.number].rows.filter(function (x) { |
| 497 | + return Math.floor(x.lineTop) == (Math.floor(start.y) + i ) |
| 498 | + }); |
497 | 499 | if (startRow.length > 0)
|
498 | 500 | return startRow;
|
499 | 501 | }
|
|
0 commit comments