fix: don't inline the font menu if more options are available (#846)

This commit is contained in:
Huang Xin
2025-04-09 11:32:24 +08:00
committed by GitHub
parent 939c7049ed
commit a26607a154
2 changed files with 1 additions and 2 deletions
@@ -190,7 +190,6 @@ const Annotator: React.FC<{ bookKey: string }> = ({ bookKey }) => {
const lineHeightValue =
parseFloat(lineHeight) || viewSettings.lineHeight * viewSettings.defaultFontSize;
const fontSizeValue = parseFloat(fontSize) || viewSettings.defaultFontSize;
console.log('style', writingMode, lineHeight, fontSize);
const strokeWidth = style === 'underline' ? 2 : 4;
const padding = (lineHeightValue - fontSizeValue - strokeWidth) / 2;
draw(Overlayer[style as keyof typeof Overlayer], { writingMode, color: hexColor, padding });
@@ -43,7 +43,7 @@ const FontDropdown: React.FC<DropdownProps> = ({
tabIndex={0}
className={clsx(
'dropdown-content bgcolor-base-200 no-triangle menu rounded-box absolute right-[-32px] z-[1] mt-4 w-44 shadow sm:right-0',
'inline max-h-80 overflow-y-scroll',
moreOptions?.length ? '' : 'inline max-h-80 overflow-y-scroll',
)}
>
{options.map(({ option, label }) => (