From 22b08e24611f6e43cc6c9e37bf74d1b48598493c Mon Sep 17 00:00:00 2001 From: Skyler Lehmkuhl Date: Tue, 24 Jul 2012 11:55:30 -0400 Subject: [PATCH] Changing colors changes colors of active object --- lightningbeam.py | 2 ++ svlgui.py | 8 ++++++++ 2 files changed, 10 insertions(+) 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)