Skip to content

Commit b785466

Browse files
author
Ben Jack
committed
scale width and height fixes
1 parent 42f6063 commit b785466

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/index.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,16 @@ window.setup = function() {
1818
}
1919

2020
window.draw = function() {
21-
width = base_size.x;
22-
height = base_size.y;
2321
background(255);
2422
vignettes.draw();
2523
}
2624

2725
window.setup_new_canvas = function(i_width, i_height){
2826
window.p5Canvas = createCanvas(i_width, i_height).canvas;
27+
window.p5Width = width;
28+
window.p5Height = height;
29+
width = base_size.x;
30+
height = base_size.y;
2931
}
3032

3133
window.mouseClicked = function(){

src/vignettes.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ export default class Vignettes{
157157
}
158158

159159
get current_scale(){
160-
return this._lock_scale ? 1 : width/this._size.x;
160+
return this._lock_scale ? 1 : p5Width/this._size.x;
161161
}
162162

163163
//-------------asset loading and displaying------------------

0 commit comments

Comments
 (0)