So I’m fairly new to graphical programming and I’m stuck at something that I’m guessing has a simple solution.
I want to make some lines out of points and then translate and scale so that my lines will be visible no matter where I decided to put the points. If there is any kind “showDrawn” function that does this for then that’d be great.
I didn’t find that however so I had to resort to trying it myself. First I found the average x and y coordinates and transformed so they were my center point:
Everything good so far.
Then I wanted to scale it to fit my screen, the problem is that scaling offsets the translation, my center points seem to veer off towards the bottom right corner when I try to zoom in.
Is there a way to scale while keeping the center I translated to in the center?
Here’s my code: