Réorganisiont du code
This commit is contained in:
@@ -108,6 +108,7 @@ class PageRender_Editor(QDialog, EDITOR_CLASS):
|
||||
self.setupUi(self)
|
||||
self.settings = QgsSettings()
|
||||
self.s = QSettings()
|
||||
self.setWindowIcon(QtGui.QIcon(resources_path('icons','icon.png')))
|
||||
|
||||
self.varLandscape = {}
|
||||
self.varPortrait = {}
|
||||
@@ -202,16 +203,14 @@ class PageRender_Editor(QDialog, EDITOR_CLASS):
|
||||
else:
|
||||
Lrotate = float((find_it[find_it[:].find('=')+2:]).split(',')[0])
|
||||
#print('sh',Psize_h,',sw',Psize_w,',lh',Plocals_h,',lw',Plocals_w,',r',Protate)
|
||||
match Lrotate:
|
||||
case 90|270:
|
||||
old = Lsize_w
|
||||
Lsize_w = Lsize_h
|
||||
Lsize_h = old
|
||||
match Protate:
|
||||
case 90|270:
|
||||
old = Psize_w
|
||||
Psize_w = Psize_h
|
||||
Psize_h = old
|
||||
if Lrotate == 90 or Lrotate == 270:
|
||||
old = Lsize_w
|
||||
Lsize_w = Lsize_h
|
||||
Lsize_h = old
|
||||
if Protate == 90 or Protate == 270:
|
||||
old = Psize_w
|
||||
Psize_w = Psize_h
|
||||
Psize_h = old
|
||||
if self.toolButton_2.text() == 'Landscape':
|
||||
children.resize(round(Lsize_h),round(Lsize_w))
|
||||
children.move(round(Llocals_h),round(Llocals_w))
|
||||
@@ -273,13 +272,12 @@ def fletch_canvas(self):
|
||||
selection = children
|
||||
if page_type == 'Portrait':
|
||||
item_rotate_object=self.varPortrait[selection.objectName()+'_rotate'][0]
|
||||
match item_rotate_object:
|
||||
case 0|180:
|
||||
sw = 0
|
||||
sh = 1
|
||||
case 90|270:
|
||||
sw = 1
|
||||
sh = 0
|
||||
if item_rotate_object == 0 or item_rotate_object == 180:
|
||||
sw = 0
|
||||
sh = 1
|
||||
if item_rotate_object == 90 or item_rotate_object == 270:
|
||||
sw = 1
|
||||
sh = 0
|
||||
if page_size == 'A3':
|
||||
size_w = (round((self.varPortrait[selection.objectName()+'_size'][sw]/3.5)*1.41))
|
||||
size_h = (round((self.varPortrait[selection.objectName()+'_size'][sh]/3.5)*1.41))
|
||||
@@ -292,13 +290,12 @@ def fletch_canvas(self):
|
||||
locals_h = (round(self.varPortrait[selection.objectName()+'_locals'][0]/3.5))
|
||||
if page_type == 'Landscape':
|
||||
item_rotate_object=self.varLandscape[selection.objectName()+'_rotate'][0]
|
||||
match item_rotate_object:
|
||||
case 0|180:
|
||||
sw = 0
|
||||
sh = 1
|
||||
case 90|270:
|
||||
sw = 1
|
||||
sh = 0
|
||||
if item_rotate_object == 0 or item_rotate_object == 180:
|
||||
sw = 0
|
||||
sh = 1
|
||||
if item_rotate_object == 90 or item_rotate_object == 270:
|
||||
sw = 1
|
||||
sh = 0
|
||||
if page_size == 'A3':
|
||||
size_w = (round((self.varLandscape[selection.objectName()+'_size'][sw]/3.5)*1.41))
|
||||
size_h = (round((self.varLandscape[selection.objectName()+'_size'][sh]/3.5)*1.41))
|
||||
|
||||
@@ -21,7 +21,7 @@ tracker=https://gitea.cenra-outils.org/api/v1/repos/CEN-RA/Plugin_QGIS/issues
|
||||
|
||||
hasProcessingProvider=no
|
||||
# Uncomment the following line and add your changelog:
|
||||
changelog=<h2>CenRa_PageRender:</h2></br><p><h3>21/10/2024 - Version 1.1: </h3> - Bouton de scroll et adaptation portrait.</p></br><p><h3>09/10/2024 - Version 1.0: </h3> - Création.</p>
|
||||
changelog=<h2>CenRa_PageRender:</h2></br><p><h3>21/10/2024 - Version 1.1: </h3> - Les match en if. </br> - Bouton de scroll et adaptation portrait.</p></br><p><h3>09/10/2024 - Version 1.0: </h3> - Création.</p>
|
||||
|
||||
# Tags are comma separated with spaces allowed
|
||||
tags=python
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 286 KiB After Width: | Height: | Size: 44 KiB |
Reference in New Issue
Block a user