improve code

This commit is contained in:
Rene
2022-07-02 15:20:09 +02:00
parent 0e0deb8550
commit 0f89a13489
14 changed files with 178 additions and 262 deletions
@@ -61,7 +61,7 @@ const getMetrics = (elm: HTMLElement): Metrics => {
const comparisonPercentBCR = getBoundingClientRect(elm!.querySelector('.percent')!);
const comparisonEndBCR = getBoundingClientRect(elm!.querySelector('.end')!);
const scrollMeasure = () => {
const condition = (raw: number) => (window.devicePixelRatio % 2 !== 0 ? raw > 1 : raw > 0);
const condition = (raw: number) => (window.devicePixelRatio % 1 !== 0 ? raw > 1 : raw > 0);
const amount = {
width: Math.max(0, comparison!.scrollWidth - comparison!.clientWidth),
height: Math.max(0, comparison!.scrollHeight - comparison!.clientHeight),