def ButtonUp(self, p, button, state):
     p = self.apply_constraint(p, state)
     SelectAndDrag.DragStop(self, p)
     cur = self.drag_cur
     oldstart = self.start
     oldend = self.end
     start, end = self.compute_endpoints()
     self.start = start
     self.end = end
     result = self.ComputeTrafo(oldstart, oldend, start, end)
     self.Normalize()
     return result
 def ButtonUp(self, p, button, state):
     if self.selection == self.selCenter:
         p = self.constrain_center(p, state)
     SelectAndDrag.DragStop(self, p)
     sel = self.selection
     if sel == self.selCenter:
         self.center = self.drag_cur
         return '', None
     else:
         self.compute_trafo(state)
         trafo = self.trafo
         if self.selection in self.selShear:
             text = _("Shear Objects")
         else:
             text = _("Rotate Objects")
         return text, trafo