Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/plugins/plugin.text_selection.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,14 @@ export class TextSelectionPlugin extends BookReaderPlugin {
if ($textLayers.length) return;
const XMLpage = await this.getPageText(pageIndex);
if (!XMLpage) return;
// Seeing some 0 left and 0 top coordinates in ToC, remove it entirely to prevent odd rendering
$(XMLpage).find("WORD").filter((_, ele) => {
const [left, , , top] = ele.getAttribute('coords').split(",").map(parseFloat);
if (left != 0 || top != 0) {
return false;
}
return true;
}).remove();
recursivelyAddCoords(XMLpage);

const totalWords = $(XMLpage).find("WORD").length;
Expand Down