cgvict / roLabelImg

Label Rotated Rect On Images for training
835 stars 223 forks source link

Image pan and zoom in and out from center are not working #13

Open divyachandana opened 4 years ago

divyachandana commented 4 years ago

could you integrate code for image pan and also image zoom in and out from center, currently its zooming form top left corner. I would be great If you could integrate the code and update ASAP

mu0gua commented 2 years ago

I also encountered the same problem

I tried to solve him in a bad way

filepath:  roLabelImg-master\libs\canvas.py    line: 159

if Qt.LeftButton & ev.buttons():
            self.MouseMove = ev.pos() - self.preMousePosition
            self.preMousePosition = ev.pos() 
            self.prevPoint = self.pos() + self.MouseMove
            self.move(self.prevPoint)
filepath:  roLabelImg-master\libs\canvas.py    line: 225

self.preMousePosition = ev.pos()

If you have any good plan, please contact me, thank you very much