rodrigocam / ar-gif

Easy to use augmented reality web components
MIT License
56 stars 19 forks source link

[REVIEW] Fix resize function based on aspect ratio of the video and window size #11

Closed pablodiegoss closed 5 years ago

pablodiegoss commented 5 years ago

Issue #8

pablodiegoss commented 5 years ago

I still need to fix the initial resize when you first open the example and test on mobile devices, but it is already working better.

rodrigocam commented 5 years ago

Thank you for your PR! With the body without style="overflow: hidden; position: fixed" the scroll bars (horizontally and vertically) are showing in the page, how can we disable the scroll bars now?

pablodiegoss commented 5 years ago

I had quite some trouble in this issue, browsers don't work well with objects bigger than their screen, so we can't use an adjusted canvas to not distort the video image. i ended up creating another canvas and cutting the image from the video adjusted for the user screen size to use in the new size of the screen canvas. The rules for mobile devices on Portrait mode, landscape and on desktops all differ, so there are conditions for each on the ResizeWindow method.

rodrigocam commented 5 years ago

Thank you, it seems good the resize and device rotation!