Skip to content

Commit

Permalink
Account for devicePixelRatio when scaling counter widgets
Browse files Browse the repository at this point in the history
  • Loading branch information
eradman committed Oct 19, 2023
1 parent 593b6ae commit b42b8df
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion viz-lib/src/visualizations/counter/Renderer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function getCounterScale(container: any) {
if (container.closest('.visualization-preview') || container.closest('.ant-tabs-tabpane')) {
return "60";
}
const fontSize = 12 + container.clientHeight / 5;
const fontSize = 12 + (container.clientHeight / window.devicePixelRatio / 5);
return fontSize > 60 ? "60" : fontSize.toFixed();
}

Expand Down

0 comments on commit b42b8df

Please sign in to comment.