diff --git a/src/lib/components/Settings/Reader/ReaderToggles.svelte b/src/lib/components/Settings/Reader/ReaderToggles.svelte index f33bfe8..15f4fcc 100644 --- a/src/lib/components/Settings/Reader/ReaderToggles.svelte +++ b/src/lib/components/Settings/Reader/ReaderToggles.svelte @@ -9,6 +9,7 @@ { key: 'boldFont', text: 'Bold font', value: $settings.boldFont }, { key: 'pageNum', text: 'Show page number', value: $settings.pageNum }, { key: 'charCount', text: 'Show character count', value: $settings.charCount }, + { key: 'bounds', text: 'Bounds', value: $settings.bounds }, { key: 'mobile', text: 'Mobile', value: $settings.mobile }, { key: 'showTimer', text: 'Show timer', value: $settings.showTimer }, { key: 'quickActions', text: 'Show quick actions', value: $settings.quickActions } diff --git a/src/lib/panzoom/util.ts b/src/lib/panzoom/util.ts index 6c1c242..d3e6fc0 100644 --- a/src/lib/panzoom/util.ts +++ b/src/lib/panzoom/util.ts @@ -147,9 +147,9 @@ export function keepInBounds() { return } - const { mobile } = get(settings) + const { mobile, bounds } = get(settings) - if (!mobile) { + if (!mobile && !bounds) { return } @@ -161,7 +161,7 @@ export function keepInBounds() { const width = container.offsetWidth * scale; const height = container.offsetHeight * scale; - const marginX = innerWidth * 0.01; + const marginX = innerWidth * 0.001; const marginY = innerHeight * 0.01; let minX = innerWidth - width - marginX; @@ -190,7 +190,6 @@ export function keepInBounds() { if (x < minX) { transform.x = minX; - } if (x > maxX) { transform.x = maxX; diff --git a/src/lib/settings/settings.ts b/src/lib/settings/settings.ts index 1b2e98c..40a7f1b 100644 --- a/src/lib/settings/settings.ts +++ b/src/lib/settings/settings.ts @@ -47,6 +47,7 @@ export type Settings = { boldFont: boolean; pageNum: boolean; charCount: boolean; + bounds: boolean; mobile: boolean; backgroundColor: string; swipeThreshold: number; @@ -73,6 +74,7 @@ const defaultSettings: Settings = { pageNum: true, charCount: false, mobile: false, + bounds: false, backgroundColor: '#030712', swipeThreshold: 50, edgeButtonWidth: 10,