Преглед на файлове

Fix float values which should be integers

Weiyi Lou преди 2 години
родител
ревизия
28503fd43b
променени са 2 файла, в които са добавени 4 реда и са изтрити 4 реда
  1. 2 2
      card_grid_generator/card_grid_generator_extension.py
  2. 2 2
      image_fitter_docker/image_fitter_docker.py

+ 2 - 2
card_grid_generator/card_grid_generator_extension.py

@@ -212,7 +212,7 @@ class CardGridGenerator(Extension):
 
                 if cropBetween:
                     for y in ySetCardsOnly:
-                        yToDo.append(y - cropMarkHeight/2)
+                        yToDo.append(int(y - cropMarkHeight/2))
 
                 for y in yToDo:
                     layer.setPixelData(cropMark, x - 1, y, cropMarkWidth, cropMarkHeight)
@@ -229,7 +229,7 @@ class CardGridGenerator(Extension):
 
                 if cropBetween:
                     for x in xSetCardsOnly:
-                        xToDo.append(x - cropMarkWidth/2)
+                        xToDo.append(int(x - cropMarkWidth/2))
 
                 for x in xToDo:
                     layer.setPixelData(cropMark, x, y - 1, cropMarkWidth, cropMarkHeight)

+ 2 - 2
image_fitter_docker/image_fitter_docker.py

@@ -121,11 +121,11 @@ class ImageFitter(DockWidget):
                 aspectRatio = layerWidth / layerHeight
                 mode = self.matchMode.currentIndex()
                 if mode == 0: # fit horizontally
-                    targetHeight = targetWidth / aspectRatio
+                    targetHeight = int(targetWidth / aspectRatio)
                     if layerHeight != targetHeight:
                         doScaling = True
                 else: # fit vertically
-                    targetWidth = targetHeight * aspectRatio
+                    targetWidth = int(targetHeight * aspectRatio)
                     if layerWidth != targetWidth:
                         doScaling = True
             else: