How to drag two pictures in canvas

drawImage loop draws two pictures. How to drag and drop
clipboard.png

separately.
Apr.15,2022

generate two canvas, one picture is drawn on a canvas


mousedown , iterate through your two pictures, determine which picture the current mouse is on according to the coordinates, and then set the picture as the drag object. Then when mousemove , modify the coordinates of the drag object. When mouseup , just set the drag object to empty.


it is recommended to use the fabric.js library. Using native libraries requires consideration of location, and when stacked together, there are many things to consider. Fabric.js has been implemented

.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b2be8c-2bab7.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b2be8c-2bab7.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?