Fit html canvas to the screen!

sourav mandal
1 min readJan 2, 2019

--

After spending about 8 hours (I have below average IQ) i finally figured out a simple method/function whatever you call it in javascript (it is my first proper day with javascript) to fit the canvas to the screen.

The canvas only fits the width but if you follow standard android screen ration it will fit most android devices but you have to implement some javascript logic to change the canvas size when user is iphone! The same function will work on both android and iphone though!

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

sourav mandal
sourav mandal

Written by sourav mandal

just a coder who forgets things so makes blogs so he can remember later

No responses yet

Write a response