Next, the small drawing tool in the previous article gradually improved its functions. The last time I talked about the operations on the file tree, mainly the creation and deletion of navigation files, this part is taken out separately because my colleague did not handle the part of the function in the project, so I implemented it myself. This time, I mainly draw elements and move them, of course, you can only draw simple components, such as straight lines and rectangles, and then select and move them. Of course, they will be gradually improved in the future, for example, rotating and drawing more responsible elements. Let's take a look at this part. It may not be very effective. Haha
It will be gradually improved in the future.
In fact, many people think that this part of the function is very easy to implement. Haha, it is really easy to implement. After processing the mousedown, mousemove, and mouseup events, you can draw components, with more detailed control, you can achieve amazing results. Haha, I personally think so. There is no profound knowledge or technology in it (I don't know if dual cache is counted, haha ).
In fact, this part of movement controls the coordinates in the mousemove event, and "real-time" changes the coordinate values of a straight line or a rectangle at a "four-point" to achieve movement. Haha. Since there is no knowledge, I won't be so embarrassed here. Haha ....