fffiloni commited on
Commit
b2da380
1 Parent(s): 09b914e

Update public/sketch.js

Browse files
Files changed (1) hide show
  1. public/sketch.js +10 -7
public/sketch.js CHANGED
@@ -239,14 +239,17 @@ function draw() {
239
 
240
  if(capture != undefined){
241
  if(!active_rearcam){
242
- //move image by the width of image to the left
243
- translate(capture.width, 0);
244
- //then scale it by -1 in the x-axis
245
- //to flip the image
246
- scale(-1, 1);
 
 
 
 
 
247
  }
248
-
249
- image(capture, 0, 0)
250
 
251
  }
252
  }
 
239
 
240
  if(capture != undefined){
241
  if(!active_rearcam){
242
+ push()
243
+ //move image by the width of image to the left
244
+ translate(capture.width, 0);
245
+ //then scale it by -1 in the x-axis
246
+ //to flip the image
247
+ scale(-1, 1);
248
+ image(capture,0, 0)
249
+ pop()
250
+ } else {
251
+ image(capture,0, 0)
252
  }
 
 
253
 
254
  }
255
  }