I’ve made lots of progress to the visual canvas functionality of my notes app.
Text and image objects work well. They are not finished yet, but the basic functionality works, like moving objects around, changing font size, formatting styles like bold and italic, and so on.
Tomorrow, I should make it possible to select objects by making drag selections. Then I should be able to move all selected objects around together. Clicking backspace should delete all selected objects. I think these features should be fairly easy to implement.
I’m more concerned about how to move the viewport to follow cursor when I move objects around. Like, if I am moving objects and the cursor is near the edge of the window, I want the canvas viewport to move in the cursor’s direction, so that I don’t hit a hard boundary.
I spent quite a bit of time figuring out how to make the zoom in and out gesture working. Luckily there is a modifier called `.gesture(magnification)`, but this will not zoom in at the cursor position which is what I wanted. From my testing, it by default zooms in at the upper left corner.
I also struggled to make two-finger swiping work to pan around the canvas. Interestingly, there is no ready to use API provided by Apple, so I had to figure out my own way.
Text and image objects work well. They are not finished yet, but the basic functionality works, like moving objects around, changing font size, formatting styles like bold and italic, and so on.
Tomorrow, I should make it possible to select objects by making drag selections. Then I should be able to move all selected objects around together. Clicking backspace should delete all selected objects. I think these features should be fairly easy to implement.
I’m more concerned about how to move the viewport to follow cursor when I move objects around. Like, if I am moving objects and the cursor is near the edge of the window, I want the canvas viewport to move in the cursor’s direction, so that I don’t hit a hard boundary.
I spent quite a bit of time figuring out how to make the zoom in and out gesture working. Luckily there is a modifier called `.gesture(magnification)`, but this will not zoom in at the cursor position which is what I wanted. From my testing, it by default zooms in at the upper left corner.
I also struggled to make two-finger swiping work to pan around the canvas. Interestingly, there is no ready to use API provided by Apple, so I had to figure out my own way.
1