コード例 #1
0
 def get_pos(view):
     if (not view):
         return (QPointF(0.0, 0.0))
     elif (isinstance(view, QPointF)):
         return (self.mapFromScene(QPointF(view.x(), view.y())))
     else:
         return (self.mapFromScene(view.mapToScene(QPointF(0.0, 0.0))))
コード例 #2
0
ファイル: unit_view.py プロジェクト: jessecrossen/jackdaw
 def get_pos(view):
   if (not view):
     return(QPointF(0.0, 0.0))
   elif (isinstance(view, QPointF)):
     return(self.mapFromScene(QPointF(view.x(), view.y())))
   else:
     return(self.mapFromScene(view.mapToScene(QPointF(0.0, 0.0))))
コード例 #3
0
ファイル: model.py プロジェクト: kewt/tf-mapper
    def switchLevel(self, newLevel):
        levels = self.__map.levels()
        if self.__map.levelExists(newLevel):
            level = self.__map.getLevelByIndex(newLevel)
            if self.__registry.currentLevel is level:
                return

            newView = level.getView()
            view = self.__registry.currentLevel.getView().views()[0]
            center = view.mapToScene(view.rect().center())
            self.__registry.mainWindow.mapView().setScene(self.__map.getLevelByIndex(newLevel).getView())
            scene = self.__registry.mainWindow.mapView().scene().getModel()
            view.centerOn(center)
コード例 #4
0
ファイル: model.py プロジェクト: x1a0/tf-mapper
    def switchLevel(self, newLevel):
        levels = self.__map.levels()
        if self.__map.levelExists(newLevel):
            level = self.__map.getLevelByIndex(newLevel)
            if self.__registry.currentLevel is level:
                return

            newView = level.getView()
            view = self.__registry.currentLevel.getView().views()[0]
            center = view.mapToScene(view.rect().center())
            self.__registry.mainWindow.mapView().setScene(
                self.__map.getLevelByIndex(newLevel).getView())
            scene = self.__registry.mainWindow.mapView().scene().getModel()
            view.centerOn(center)