| author | |
| committer | |
| log | 5fe29c89456c151529a63ddcbf132b4c518f1838 |
| tree | 5a11eab0f790268406083e213806935ca71a2fe3 |
| parent | 044a6e168ad1eb213c2c7c277034e65c638cc937 |
| signature | Signed by PGP key B5690EEEBB952194 |
2 files changed, 1 insertions(+), 16 deletions(-)
apps/mobile/src/lib/appearancePreferences.test.ts+1-6| ... | @@ -13,8 +13,6 @@ import { | ... | @@ -13,8 +13,6 @@ import { |
| 13 | resolveMobileCodeSurface, | 13 | resolveMobileCodeSurface, |
| 14 | resolveNativeMarkdownTypography, | 14 | resolveNativeMarkdownTypography, |
| 15 | resolveTextScaleVariables, | 15 | resolveTextScaleVariables, |
| 16 | stepBaseFontSize, | ||
| 17 | stepCodeFontSize, | ||
| 18 | stepTerminalFontSize, | 16 | stepTerminalFontSize, |
| 19 | } from "./appearancePreferences"; | 17 | } from "./appearancePreferences"; |
| 20 | 18 | ||
| ... | @@ -73,11 +71,8 @@ describe("appearancePreferences", () => { | ... | @@ -73,11 +71,8 @@ describe("appearancePreferences", () => { |
| 73 | expect(normalizeCodeFontSize(30)).toBe(18); | 71 | expect(normalizeCodeFontSize(30)).toBe(18); |
| 74 | }); | 72 | }); |
| 75 | 73 | ||
| 76 | it("steps font sizes within bounds", () => { | 74 | it("steps terminal font size within bounds", () => { |
| 77 | expect(stepTerminalFontSize(6, -1)).toBe(6); | 75 | expect(stepTerminalFontSize(6, -1)).toBe(6); |
| 78 | expect(stepBaseFontSize(11, -1)).toBe(11); | ||
| 79 | expect(stepCodeFontSize(8, -1)).toBe(8); | ||
| 80 | expect(stepBaseFontSize(15, 1)).toBe(16); | ||
| 81 | }); | 76 | }); |
| 82 | 77 | ||
| 83 | it("scales markdown typography from the base size", () => { | 78 | it("scales markdown typography from the base size", () => { |
apps/mobile/src/lib/appearancePreferences.ts-10| ... | @@ -235,22 +235,12 @@ export function resolveNativeMarkdownTypography(baseFontSize: number): NativeMar | ... | @@ -235,22 +235,12 @@ export function resolveNativeMarkdownTypography(baseFontSize: number): NativeMar |
| 235 | }; | 235 | }; |
| 236 | } | 236 | } |
| 237 | 237 | ||
| 238 | export function stepBaseFontSize(current: number, direction: -1 | 1): number { | ||
| 239 | const next = direction === -1 ? current - BASE_FONT_SIZE_STEP : current + BASE_FONT_SIZE_STEP; | ||
| 240 | return normalizeBaseFontSize(next); | ||
| 241 | } | ||
| 242 | |||
| 243 | export function stepTerminalFontSize(current: number, direction: -1 | 1): number { | 238 | export function stepTerminalFontSize(current: number, direction: -1 | 1): number { |
| 244 | const next = | 239 | const next = |
| 245 | direction === -1 ? current - TERMINAL_FONT_SIZE_STEP : current + TERMINAL_FONT_SIZE_STEP; | 240 | direction === -1 ? current - TERMINAL_FONT_SIZE_STEP : current + TERMINAL_FONT_SIZE_STEP; |
| 246 | return normalizeTerminalFontSize(next); | 241 | return normalizeTerminalFontSize(next); |
| 247 | } | 242 | } |
| 248 | 243 | ||
| 249 | export function stepCodeFontSize(current: number, direction: -1 | 1): number { | ||
| 250 | const next = direction === -1 ? current - CODE_FONT_SIZE_STEP : current + CODE_FONT_SIZE_STEP; | ||
| 251 | return normalizeCodeFontSize(next); | ||
| 252 | } | ||
| 253 | |||
| 254 | export { | 244 | export { |
| 255 | DEFAULT_TERMINAL_FONT_SIZE, | 245 | DEFAULT_TERMINAL_FONT_SIZE, |
| 256 | MAX_TERMINAL_FONT_SIZE, | 246 | MAX_TERMINAL_FONT_SIZE, |