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))
|
||||
|
||||
Reference in New Issue
Block a user