Closed agrajagrawal closed 3 years ago
@ExpressHermes We won't be needing a function to remove duplicate code as if we remove duplicated code from mouseDrag function it will work fine as variables are defined globally and before mouseDrag the mouseDown will necessarily be called which initializes variable. And On the other hand, I have done some formatting manually and also used VS code extension prettier code formatter! It looks pretty clean now :)
Almost all the code inside the onMouseDown
and onMouseDrag
is duplicated. Putting it into a function and calling that function as a callback will increase the readability of the whole code. The global variables will remain global.
Almost all the code inside the
onMouseDown
andonMouseDrag
is duplicated. Putting it into a function and calling that function as a callback will increase the readability of the whole code. The global variables will remain global.
Okay I will be working on it by tomorrow 😁
@ExpressHermes I have removed the toggle-to-fill feature as I thought of something more innovation Now we have two color inputs border color and fill color Fill color is set to default as canvas color!! i.e "#EEEEEE" Different colors make it look cooler :) https://agrajagrawal.github.io/Primitive-Paint/circle.html
I have added a checkbox to fill shapes with brush's color