Week 3 - Dealing with Problems#
What did you do this week?#
This week was full of researching, playing around with things, prototyping ideas, etc. I started with last week’s clamping issue and managed to solve this issue while drawing shapes by clipping the mouse position according to canvas size, but it didn’t solve the problem with translating these shapes. I tried solving this using various approaches, but if one thing would get fixed, other things would raise a new error.
Instead of spending too much time on this, I thought it would be great to switch to other work and discuss this problem with the mentors. So I started to create a basic prototype for the properties panel, which would be used to manipulate different properties of the selected shape.
But then the question arises How to efficiently take data from the user?, Which data format would be easy to compute and best for user experience? and so on.
Alongside I was trying to create polylines but whenever I wanted to start the creation of the second line the dragging event wasn’t triggered as each dragging event required a left mouse click event associated with it. I tried to do that manually but it didn’t work.
Did you get stuck anywhere?#
As I mentioned when I translated the shapes it would go out of the canvas bounds. Here the problem was with the reference point by which I was calculating all the transformations it changed depending on various cases as shown below.
This became more complex when working with a line because then the cases again differ depending on the quadrant in which the line lies. I worked around and tried to compute the bounds but it wasn’t getting updated as the shape transformed.
What is coming up next?#
Solving the clamping issue to restrict the shape’s position to be in the canvas boundaries.