libroar/RoarCanvasCommandsTools.py:canvasTool(): call dropTarget.done() when setting new tool from external object as current tool.

This commit is contained in:
Lucio Andrés Illanes Albornoz 2019-09-16 11:23:47 +02:00
parent 2834fe531b
commit 4d4ce6f86e

View File

@ -24,6 +24,10 @@ class RoarCanvasCommandsTools():
@GuiSelectDecorator(6, "Text", "&Text", ["toolText.png"], [wx.ACCEL_CTRL, ord("T")], False) @GuiSelectDecorator(6, "Text", "&Text", ["toolText.png"], [wx.ACCEL_CTRL, ord("T")], False)
def canvasTool(self, f, idx): def canvasTool(self, f, idx):
def canvasTool_(event): def canvasTool_(event):
if (self.currentTool.__class__ == ToolObject) \
and (self.currentTool.toolState > self.currentTool.TS_NONE) \
and self.currentTool.external:
self.parentCanvas.dropTarget.done()
self.lastTool, self.currentTool = self.currentTool, [ToolCircle, None, ToolFill, ToolLine, ToolObject, ToolRect, ToolText][idx] self.lastTool, self.currentTool = self.currentTool, [ToolCircle, None, ToolFill, ToolLine, ToolObject, ToolRect, ToolText][idx]
if self.currentTool != None: if self.currentTool != None:
self.currentTool = self.currentTool() self.currentTool = self.currentTool()