Permalink
Browse files

Round coordinates of relative-anchored Text objects, for better alias…

…ing.
  • Loading branch information...
1 parent 2a6f874 commit 73be73f6278d7a3f5e2670717ee78228978b1603 @encukou committed Mar 2, 2011
Showing with 3 additions and 2 deletions.
  1. +1 −1 demo.py
  2. +2 −1 gillcup/graphics/text.py
View
@@ -40,7 +40,7 @@ def demo():
opacityLayer2 = Layer(opacityLayer, scale=(1.5, 1.5), opacity=.75, pixelization=(2, 8))
ColorRect(opacityLayer2, color=(.5, .5, .5), anchorPoint=(.5, .5))
ColorRect(opacityLayer, position=(-.25, 0), anchorPoint=(.5, .5), color=(1, 1, 1), rotation=45).rotateBy(-100, time=1, infinite=True)
- text = Text(topLayer, 'Hello world!', size=(0.5, 0), position=(.5, .5))
+ text = Text(topLayer, 'Hello world!', position=(.5, .5), scale=(.001, .001))
text.setRelativeAnchor(0.5, 0.25)
text.scaleTo(0, time=3, dt=2, easing='quad')
text.rotateTo(1800, time=3, dt=2, easing='quad').chain(text.die)
View
@@ -73,7 +73,8 @@ def getRealSize(self):
def _relativePoint(self, x, y):
width, height = self.getRealSize()
- return width * x, height * y
+ x, y = width * x, height * y
+ return int(x), int(y)
def relativeAnchorSetter(self, x, y):
return FunctionAction(self.setRelativeAnchor, x, y)

0 comments on commit 73be73f

Please sign in to comment.