Skip to content

Commit

Permalink
Partially revert 7c624f7, don't use pixelRatio
Browse files Browse the repository at this point in the history
Devices that report a pixel ratio > 2 create plots that contain tiny
text. So, temporarily ignore `devicePixelRatio` for the moment, until
we have a better handle on how different types of devices set and use
the value.

This returns canvas scaling to the behaviour in webR 0.3.3.
  • Loading branch information
georgestagg committed Jul 8, 2024
1 parent 7c624f7 commit 6a9597c
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/repl/components/Plot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@ export function Plot({

// Resize the canvas() device when the plotting pane changes size
plotInterface.resize = (direction, px) => {
const pixelRatio = window.devicePixelRatio || 1.0;
plotSize.current[direction] = Math.max( pixelRatio * px / 1.5, 150);
plotSize.current[direction] = px;
void webR.init().then(async () => {
await webR.evalRVoid(`
# Close any active canvas devices
Expand Down

0 comments on commit 6a9597c

Please sign in to comment.