mirror of
https://github.com/readest/readest.git
synced 2026-05-05 23:37:16 +00:00
persist max block size setting in LayoutPanel component (#134)
https://github.com/readest/readest/issues/131
This commit is contained in:
parent
33d4dcd740
commit
86dc32dab3
1 changed files with 11 additions and 0 deletions
|
|
@ -119,6 +119,17 @@ const LayoutPanel: React.FC<{ bookKey: string }> = ({ bookKey }) => {
|
|||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [maxInlineSize]);
|
||||
|
||||
useEffect(() => {
|
||||
viewSettings.maxBlockSize = maxBlockSize;
|
||||
setViewSettings(bookKey, viewSettings);
|
||||
if (isFontLayoutSettingsGlobal) {
|
||||
settings.globalViewSettings.maxBlockSize = maxBlockSize;
|
||||
setSettings(settings);
|
||||
}
|
||||
view?.renderer.setAttribute('max-block-size', `${maxBlockSize}px`);
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [maxBlockSize]);
|
||||
|
||||
useEffect(() => {
|
||||
// global settings are not supported for writing mode
|
||||
viewSettings.writingMode = writingMode;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue