summaryrefslogtreecommitdiffstats
path: root/iw
diff options
context:
space:
mode:
authorChris Lumens <clumens@redhat.com>2009-04-03 11:49:24 -0400
committerChris Lumens <clumens@redhat.com>2009-04-06 14:52:27 -0400
commit8f4ea37b72deb5e6a8bcf12091aa44eb8f6f1056 (patch)
treea58d7c1743837c718fbdd31b8ce04f38812ea5ae /iw
parent87cddf9ced397496eae90dcd8104efab0e1d41f7 (diff)
downloadanaconda-8f4ea37b72deb5e6a8bcf12091aa44eb8f6f1056.tar.gz
anaconda-8f4ea37b72deb5e6a8bcf12091aa44eb8f6f1056.tar.xz
anaconda-8f4ea37b72deb5e6a8bcf12091aa44eb8f6f1056.zip
For very small disks, don't try to display a stripe in the graph (#480484).
Diffstat (limited to 'iw')
-rw-r--r--iw/partition_gui.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/iw/partition_gui.py b/iw/partition_gui.py
index 0105ef596..826e77865 100644
--- a/iw/partition_gui.py
+++ b/iw/partition_gui.py
@@ -150,8 +150,14 @@ class DiskStripeSlice:
else:
width = CANVAS_WIDTH_640
+ # If it's a very, very small partition then there's no point in trying
+ # cut off a piece of the parent disk's stripe for it.
+ if totalSectors == 0:
+ return
+
xoffset = self.partition.geometry.start / totalSectors * width
xlength = self.partition.geometry.length / totalSectors * width
+
if self.partition.type & parted.PARTITION_LOGICAL:
yoffset = 0.0 + LOGICAL_INSET
yheight = STRIPE_HEIGHT - (LOGICAL_INSET * 2)