mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-10 00:04:23 -04:00
Check for non-zero cell sizes
This commit is contained in:
parent
da514d0e5e
commit
33e1d4fba9
@ -120,6 +120,9 @@ class HeatmapPixelSizeWidget(BASE, WIDGET):
|
||||
return
|
||||
|
||||
cell_size = self.raster_bounds.height() / rows
|
||||
if cell_size == 0:
|
||||
return
|
||||
|
||||
cols = max(round(self.raster_bounds.width() / cell_size) + 1, 1)
|
||||
self.mColumnsSpinBox.blockSignals(True)
|
||||
self.mColumnsSpinBox.setValue(cols)
|
||||
@ -135,6 +138,9 @@ class HeatmapPixelSizeWidget(BASE, WIDGET):
|
||||
return
|
||||
|
||||
cell_size = self.raster_bounds.width() / (cols - 1)
|
||||
if cell_size == 0:
|
||||
return
|
||||
|
||||
rows = max(round(self.raster_bounds.height() / cell_size), 1)
|
||||
self.mRowsSpinBox.blockSignals(True)
|
||||
self.mRowsSpinBox.setValue(rows)
|
||||
|
@ -324,6 +324,9 @@ class PixelSizeWidget(BASE, WIDGET):
|
||||
return
|
||||
|
||||
cell_size = self.extent.height() / rows
|
||||
if cell_size == 0:
|
||||
return
|
||||
|
||||
cols = max(round(self.extent.width() / cell_size) + 1, 1)
|
||||
self.mColumnsSpinBox.blockSignals(True)
|
||||
self.mColumnsSpinBox.setValue(cols)
|
||||
@ -339,6 +342,9 @@ class PixelSizeWidget(BASE, WIDGET):
|
||||
return
|
||||
|
||||
cell_size = self.extent.width() / (cols - 1)
|
||||
if cell_size == 0:
|
||||
return
|
||||
|
||||
rows = max(round(self.extent.height() / cell_size), 1)
|
||||
self.mRowsSpinBox.blockSignals(True)
|
||||
self.mRowsSpinBox.setValue(rows)
|
||||
|
Loading…
x
Reference in New Issue
Block a user