~ubuntu-branches/ubuntu/oneiric/kdegames/oneiric

« back to all changes in this revision

Viewing changes to kajongg/src/board.py

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell
  • Date: 2011-04-04 15:25:32 UTC
  • mfrom: (1.2.60 upstream)
  • Revision ID: james.westby@ubuntu.com-20110404152532-jygsoedj7n0z54k1
Tags: 4:4.6.2-0ubuntu1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
837
837
        self.height = metrics.height()
838
838
        self.setRect(0, 0, self.width, self.height)
839
839
        self.resetTransform()
840
 
        rotateCenter(self, -self.side.rotation())
841
 
        if self.side.rotation() % 180 == 0:
842
 
            self.translate(-self.rect().width()/2, 0)
 
840
        rotation = self.side.rotation()
 
841
        rotateCenter(self, -rotation)
 
842
        if rotation % 180 == 0:
 
843
            yOffset = self.rect().height()
 
844
            if rotation == 0:
 
845
                yOffset = 2 * -yOffset
 
846
            self.translate(-self.rect().width()/2, yOffset)
843
847
        else:
844
848
            self.translate(-self.rect().width()/2, -self.rect().height()/2)
845
849
    def paint(self, painter, dummyOption, dummyWidget):