Skip to content

Commit d815cd0

Browse files
committed
fix plot scaling again
1 parent 365f904 commit d815cd0

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/plots/canopy.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,11 @@ export class Pannable extends Etch {
8686
this.initialScale = 1
8787
if (item.naturalHeight && item.naturalWidth && this.containerRect) {
8888
// only scale down, not up:
89-
this.initalScale = Math.min(this.containerRect.width/item.naturalWidth, 1)
89+
this.initialScale = Math.min(
90+
this.containerRect.width/item.naturalWidth,
91+
this.containerRect.height/item.naturalHeight,
92+
1
93+
)
9094
}
9195
this.update()
9296
}

0 commit comments

Comments
 (0)