Good afternoon, I'm developing a canvas system and I have some problems when I scale and drag components. The calculations I am making are. Positioning of the element at the origin: - xElement / pointXClick - yElement / dotYClick
The width and height ratio multiplies by the scale (widthElement * scale, heightElement * scale). This works correctly if the x-axis and the y-axis are positive but sometimes I'm drawing in negative -, - +, + - positions. Does anyone know of any trick or magic formula to not have these kind of problems, so you can draw in any quadrant correctly?