diff --git a/lightningbeam.py b/lightningbeam.py index 1ae2941..8a1de96 100755 --- a/lightningbeam.py +++ b/lightningbeam.py @@ -309,6 +309,8 @@ root.onMouseMove = onMouseMoveGroup root.onMouseDrag = onMouseDragGroup root.onKeyDown = onKeyDownGroup +svlgui.root = root + e=ellipse(100,100,100,50,None) e.onMouseDown = onMouseDownObj e.onMouseMove = onMouseMoveObj diff --git a/svlgui.py b/svlgui.py index 29b4563..a083dee 100644 --- a/svlgui.py +++ b/svlgui.py @@ -1866,6 +1866,7 @@ class framewrapper (object): miny = property(getminy) maxx = property(getmaxx) maxy = property(getmaxy) + def hitTest(self, x, y): x,y = self.transformcoords(x,y) return self.obj.hitTest(x, y) @@ -2623,11 +2624,18 @@ class ColorSelectionWindow: def onClickRectFill(self,x,y): global FILLCOLOR FILLCOLOR = Color(colors.colorArray(int(x/16))[int(y/16)]) + if root.descendItem().activelayer.currentselect: + root.descendItem().activelayer.currentselect.fillcolor = FILLCOLOR + root.descendItem().activelayer.currentselect.filled = True + root.descendItem().activelayer.currentselect.update() self.window.dismiss() raise ObjectDeletedError def onClickRectLine(self,x,y): global LINECOLOR LINECOLOR = Color(colors.colorArray(int(x/16))[int(y/16)]) + if root.descendItem().activelayer.currentselect: + root.descendItem().activelayer.currentselect.linecolor = LINECOLOR + root.descendItem().activelayer.currentselect.update() self.window.dismiss() raise ObjectDeletedError canvas = Canvas(336,208)