Skip to content

Commit

Permalink
Remove R check for plot padding.
Browse files Browse the repository at this point in the history
  • Loading branch information
derpylz committed Dec 10, 2022
1 parent 10a3615 commit 08e8f7e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
2 changes: 1 addition & 1 deletion dist/babyplots.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/babyplots.js.map

Large diffs are not rendered by default.

19 changes: 11 additions & 8 deletions src/babyplots.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2346,14 +2346,17 @@ export class Plots {
*/
resize(width?: number, height?: number): Plots {
if (width !== undefined && height !== undefined) {
if (this.R) {
let pad = parseInt(document.body.style.padding.substring(0, document.body.style.padding.length - 2));
this.canvas.width = width - 2 * pad;
this.canvas.height = height - 2 * pad;
} else {
this.canvas.width = width;
this.canvas.height = height;
}
// if (this.R) {
// let pad = parseInt(document.body.style.padding.substring(0, document.body.style.padding.length - 2));
// this.canvas.width = width - 2 * pad;
// this.canvas.height = height - 2 * pad;
// } else {
// this.canvas.width = width;
// this.canvas.height = height;
// }

this.canvas.width = width;
this.canvas.height = height;
}
this._fsUIDirty = true;
this._resizePublishOverlay();
Expand Down

0 comments on commit 08e8f7e

Please sign in to comment.