refactor(ComparisonView): size crossfade window per line
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
import {
|
||||
type ComparisonLine,
|
||||
computeLineRenderModel,
|
||||
windowSizeForLine,
|
||||
} from '$entities/Font';
|
||||
import { getTypographySettingsStore } from '$features/AdjustTypography';
|
||||
import { getComparisonStore } from '../../model';
|
||||
@@ -24,16 +25,14 @@ interface Props {
|
||||
* Count of chars the slider has passed, from `findSplitIndex`.
|
||||
*/
|
||||
split: number;
|
||||
/**
|
||||
* Number of chars in the crossfade window around the split.
|
||||
*/
|
||||
windowSize: number;
|
||||
}
|
||||
|
||||
let { line, split, windowSize }: Props = $props();
|
||||
let { line, split }: Props = $props();
|
||||
|
||||
const comparisonStore = getComparisonStore();
|
||||
|
||||
const windowSize = $derived(windowSizeForLine(line.chars.length));
|
||||
|
||||
const model = $derived(computeLineRenderModel(line, split, windowSize));
|
||||
|
||||
const typography = getTypographySettingsStore();
|
||||
|
||||
Reference in New Issue
Block a user