mirror of
https://gitlab.com/ArkHost/HelixNotes.git
synced 2026-11-22 11:04:56 +01:00
17 lines
461 B
TypeScript
17 lines
461 B
TypeScript
export type WheelFontSizeAction = 'ignore' | 'block' | 'increase' | 'decrease';
|
|
|
|
interface WheelModifierInput {
|
|
ctrlKey: boolean;
|
|
metaKey: boolean;
|
|
deltaY: number;
|
|
}
|
|
|
|
export function getWheelFontSizeAction(
|
|
event: WheelModifierInput,
|
|
scrollToChangeFontSize: boolean,
|
|
): WheelFontSizeAction {
|
|
if (!event.ctrlKey && !event.metaKey) return 'ignore';
|
|
if (!scrollToChangeFontSize) return 'block';
|
|
return event.deltaY < 0 ? 'increase' : 'decrease';
|
|
}
|