Skip to content

Fix window resize issue#1

Open
faizkhan12 wants to merge 1 commit into
achrafl0:mainfrom
faizkhan12:main
Open

Fix window resize issue#1
faizkhan12 wants to merge 1 commit into
achrafl0:mainfrom
faizkhan12:main

Conversation

@faizkhan12
Copy link
Copy Markdown

Title: Fix: Resizing Issue with Circle and Line Intersection on Canvas

##PROBLEM
This PR addresses an issue in the current implementation of our canvas-based UI where a circle is drawn with a line intersecting at its base. The problem arises when the canvas is resized. In the current state, upon resizing the window, the line overflows and does not maintain its correct position relative to the circle. This misalignment persists until the page is refreshed, which is not an ideal user experience.

##SOLUTION
To resolve this I have implemented a window.addEventListener('resize'), isolates the drawMainCircle and drawConnectingLine in one separate function and passes it to window.addEventListener('resize')

##IMPACT
This fix enhances the user experience by ensuring that the visual elements on our canvas remain consistent and correctly positioned across various window sizes. It promotes a more dynamic and responsive design, adapting to changes in the browser window's dimensions immediately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant