MCPcopy Create free account
hub / github.com/fontsource/fontsource / handleVariation

Function handleVariation

website/app/components/preview/VariableButtons.tsx:27–35  ·  view source on GitHub ↗
(value: number)

Source from the content-addressed store, hash-verified

25const VariableButton = observer(
26 ({ state$, tag, label, axes, description }: VariableButtonProps) => {
27 const handleVariation = (value: number) => {
28 // If ital is changed, set italic to true
29 if (tag === 'ital' && value > 0) {
30 state$.preview.italic.set(true);
31 } else if (tag === 'ital' && value === 0) {
32 state$.preview.italic.set(false);
33 }
34 state$.variable.assign({ [tag]: value });
35 };
36
37 const resetVariation = () => {
38 if (tag === 'ital') state$.preview.italic.set(false);

Callers

nothing calls this directly

Calls 1

setMethod · 0.80

Tested by

no test coverage detected