def picking_update(self, device, x_root, y_root):
     """Update brush and layer during & after picking."""
     tdw, x, y = TiledDrawWidget.get_tdw_under_device(device)
     if tdw is None:
         return
     color = tdw.pick_color(x, y)
     cm = self.app.brush_color_manager
     cm.set_color(color)
Exemple #2
0
 def picking_update(self, device, x_root, y_root):
     """Update brush and layer during & after picking."""
     tdw, x, y = TiledDrawWidget.get_tdw_under_device(device)
     if tdw is None:
         return
     color = tdw.pick_color(x, y)
     cm = self.app.brush_color_manager
     cm.set_color(color)
 def picking_update(self, device, x_root, y_root):
     """Update brush and layer during & after picking."""
     # Can only pick from TDWs
     tdw, x, y = TiledDrawWidget.get_tdw_under_device(device)
     if tdw is None:
         return
     # Determine which document controller owns that tdw
     doc = None
     for d in Document.get_instances():
         if tdw is d.tdw:
             doc = d
             break
     if doc is None:
         return
     # Get that controller to do the pick.
     # Arguably this should be direct to the model.
     x, y = tdw.display_to_model(x, y)
     doc.pick_context(x, y)
Exemple #4
0
 def picking_update(self, device, x_root, y_root):
     """Update brush and layer during & after picking."""
     # Can only pick from TDWs
     tdw, x, y = TiledDrawWidget.get_tdw_under_device(device)
     if tdw is None:
         return
     # Determine which document controller owns that tdw
     doc = None
     for d in Document.get_instances():
         if tdw is d.tdw:
             doc = d
             break
     if doc is None:
         return
     # Get that controller to do the pick.
     # Arguably this should be direct to the model.
     x, y = tdw.display_to_model(x, y)
     doc.pick_context(x, y)