diff --git a/apps/readest-app/src/app/reader/components/annotator/Annotator.tsx b/apps/readest-app/src/app/reader/components/annotator/Annotator.tsx index 539ef721..c4b59929 100644 --- a/apps/readest-app/src/app/reader/components/annotator/Annotator.tsx +++ b/apps/readest-app/src/app/reader/components/annotator/Annotator.tsx @@ -261,13 +261,14 @@ const Annotator: React.FC<{ bookKey: string }> = ({ bookKey }) => { const node = range.startContainer; const el = node.nodeType === 1 ? node : node.parentElement; const { writingMode, lineHeight, fontSize } = defaultView.getComputedStyle(el); - const lineHeightValue = - parseFloat(lineHeight) || viewSettings.lineHeight * viewSettings.defaultFontSize; const fontSizeValue = parseFloat(fontSize) || viewSettings.defaultFontSize; + const lineHeightValue = parseFloat(lineHeight) || viewSettings.lineHeight * fontSizeValue; const strokeWidth = 2; + const verticalCompensation = appService?.isMobile ? 0 : -1; + const horizontalCompensation = appService?.isMobile ? -1 : 0; const padding = viewSettings.vertical - ? (lineHeightValue - fontSizeValue - strokeWidth) / 2 - : strokeWidth; + ? (lineHeightValue - fontSizeValue) / 2 - strokeWidth + verticalCompensation + : (lineHeightValue - fontSizeValue) / 2 - strokeWidth + horizontalCompensation; draw(Overlayer[style as keyof typeof Overlayer], { writingMode, color: hexColor, padding }); } }; diff --git a/apps/readest-app/src/app/reader/components/annotator/TranslatorPopup.tsx b/apps/readest-app/src/app/reader/components/annotator/TranslatorPopup.tsx index 1fb4efb3..0626e846 100644 --- a/apps/readest-app/src/app/reader/components/annotator/TranslatorPopup.tsx +++ b/apps/readest-app/src/app/reader/components/annotator/TranslatorPopup.tsx @@ -201,7 +201,7 @@ const TranslatorPopup: React.FC = ({ )} -
+
{provider && !loading && diff --git a/packages/foliate-js b/packages/foliate-js index 43f30812..c80ead5f 160000 --- a/packages/foliate-js +++ b/packages/foliate-js @@ -1 +1 @@ -Subproject commit 43f30812d19f49c9539cf9ca4fb558f90422c624 +Subproject commit c80ead5f347385b09cb3c776b2cd26fc7cea8cda