~ubuntu-branches/debian/sid/pysatellites/sid

« back to all changes in this revision

Viewing changes to traj_satellite.py

  • Committer: Bazaar Package Importer
  • Author(s): Georges Khaznadar
  • Date: 2010-08-15 19:20:40 UTC
  • Revision ID: james.westby@ubuntu.com-20100815192040-bt23zawt1tkhxb9v
Tags: 1.0-3
* added a dependency on misc:Depends
* upgraded the Standards-Version to 3.9.1 and the compat to 7
* removed the build-dependency on python-dev
* fixed a misspelling in the description
* fixed the versionless GPL reference in the file debian/copyright
* replaced dh_clean -k by dh_prep in debian/rules
* replaced Apps by Applications in debian/menu
* first publication in Debian. Closes: #593132

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#! /usr/bin/python
2
1
# -*- coding: utf-8 -*-
3
2
# Résolution numérique d'un problème à un corps soumis à un
4
3
# potentiel newtonien (en 1/r^2)
358
357
        
359
358
    def paintEvent(self, event):
360
359
        painter = QPainter()
 
360
        painter.begin(self)
361
361
        painter.setBrush(Qt.CrossPattern)
362
362
        painter.setPen(Qt.green)
363
 
        painter.begin(self)
364
363
        
365
364
        rayon=int(self.mainWin.getRayonAstre()/self.echelle)
366
365
        painter.drawLine(self.milieuX, 0, self.milieuX, self.milieuY*2)
367
366
        painter.drawLine(0,self.milieuY , 2*self.milieuX, self.milieuY)
368
367
        img=self.astreImg
369
368
        sourcerect=QRect(0,0,512,512)
370
 
        targetrect=QRect(self.milieuX-rayon,self.milieuY-rayon,2*rayon,2*rayon)  #TODO : il faudrait redessiner le rectangle en fonction de l'échelle
 
369
        self.milieuX=self.size().width()/2
 
370
        self.milieuY=self.size().height()/2
 
371
        targetrect=QRect(self.milieuX-rayon,self.milieuY-rayon,2*rayon,2*rayon)
 
372
        #TODO : il faudrait redessiner le rectangle en fonction de l'échelle
 
373
        #TODO : la taille n'est pas bien calculée quand on redimensionne !!!
371
374
        painter.drawEllipse(targetrect)
372
375
        painter.drawImage(targetrect,img,sourcerect)
373
376
        painter.end()