Commit 3380cd63 authored by Timm Bäder's avatar Timm Bäder 👎 Committed by Daniel Boles

levelbar: Don't allocate 0 blocks

Could result in a division by zero later on and doesn't make a lot of
sense anyway.
parent 46decc61
......@@ -508,6 +508,9 @@ gtk_level_bar_allocate_trough_discrete (GtkLevelBar *self,
gtk_level_bar_get_min_block_size (self, &block_width, &block_height);
num_blocks = gtk_level_bar_get_num_blocks (self);
if (num_blocks == 0)
if (self->priv->orientation == GTK_ORIENTATION_HORIZONTAL)
block_width = MAX (block_width, (gint) floor (allocation->width / num_blocks));
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment