Skip to content

Commit

Permalink
fix: prevent too big or too small custom font scale
Browse files Browse the repository at this point in the history
  • Loading branch information
farfromrefug committed Dec 9, 2024
1 parent 7951854 commit d721da9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions app/components/settings/FontSizeSettingScreen.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,10 @@
}
const updateFonscale = debounce((value) => {
const newValue = parseFloat(value);
setFontScale(newValue);
const newValue = Math.max(Math.min(parseFloat(value), 2), 0.5);
if (!isNaN(newValue)) {
setFontScale(newValue);
}
}, 500);
function onTextChange({ object, value }: PropertyChangeData<TextField>) {
if (resetCursorPosition) {
Expand Down

0 comments on commit d721da9

Please sign in to comment.