Added scaling to all four corners.

This commit is contained in:
Skyler Lehmkuhl 2012-09-11 17:27:35 -04:00
parent d4e08afbcd
commit 50e4b82f18
2 changed files with 15 additions and 6 deletions

View File

@ -163,11 +163,11 @@ def onMouseDragObj(self, x, y):
self.x = x-self.initx self.x = x-self.initx
self.y = y-self.inity self.y = y-self.inity
elif svlgui.MODE=="s": elif svlgui.MODE=="s":
print ((self.maxx/2.0+self.minx)-x)/(self.maxx/2.0) if svlgui.SCALING:
self.xscale = ((self.maxx/2.0+self.minx)-x)/(self.maxx/2.0) self.xscale = ((self.maxx/2.0+self.minx)-x)/(self.maxx/2.0)
self.yscale = ((self.maxy/2.0+self.miny)-y)/(self.maxy/2.0) self.yscale = ((self.maxy/2.0+self.miny)-y)/(self.maxy/2.0)
# self.x = (self.x+self.maxx/2)-((self.maxx/2)*self.xscale) # self.x = (self.x+self.maxx/2)-((self.maxx/2)*self.xscale)
# self.yscale = y/100.0 # self.yscale = y/100.0
def onMouseDragText(self, x, y): def onMouseDragText(self, x, y):
self.x = x-self.initx self.x = x-self.initx
self.y = y-self.inity self.y = y-self.inity

View File

@ -2369,7 +2369,15 @@ class Group (object):
else: else:
if MODE in [" ", "s", "b"]: if MODE in [" ", "s", "b"]:
if self.activelayer.currentselect and MODE=="s": if self.activelayer.currentselect and MODE=="s":
if self.activelayer.currentselect.minx-5<x<self.activelayer.currentselect.minx+5: global SCALING
if (self.activelayer.currentselect.minx-5<x<self.activelayer.currentselect.minx+5 and \
self.activelayer.currentselect.miny-5<y<self.activelayer.currentselect.miny+5) or \
(self.activelayer.currentselect.minx-5<x<self.activelayer.currentselect.minx+5 and \
self.activelayer.currentselect.miny+self.activelayer.currentselect.maxy-5<y<self.activelayer.currentselect.miny+self.activelayer.currentselect.maxy+5) or \
(self.activelayer.currentselect.minx+self.activelayer.currentselect.maxx-5<x<self.activelayer.currentselect.minx+self.activelayer.currentselect.maxx+5 and \
self.activelayer.currentselect.miny+self.activelayer.currentselect.maxy-5<y<self.activelayer.currentselect.miny+self.activelayer.currentselect.maxy+5) or \
(self.activelayer.currentselect.minx+self.activelayer.currentselect.maxx-5<x<self.activelayer.currentselect.minx+self.activelayer.currentselect.maxx+5 and \
self.activelayer.currentselect.miny-5<y<self.activelayer.currentselect.miny+5):
SCALING = True SCALING = True
else: else:
test = False test = False
@ -2389,6 +2397,7 @@ class Group (object):
def onMouseDown(self, self1, x, y): def onMouseDown(self, self1, x, y):
pass pass
def _onMouseUp(self,x,y): def _onMouseUp(self,x,y):
global SCALING
SCALING = False SCALING = False
x, y = self.localtransform(x, y) x, y = self.localtransform(x, y)
if self.activelayer.level and MODE in [" ", "s"]: if self.activelayer.level and MODE in [" ", "s"]: