levelbar: Don't allocate 0 blocks
Could result in a division by zero later on and doesn't make a lot of sense anyway.
This commit is contained in:
parent
46decc6182
commit
3380cd63c1
@ -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)
|
||||
return;
|
||||
|
||||
if (self->priv->orientation == GTK_ORIENTATION_HORIZONTAL)
|
||||
{
|
||||
block_width = MAX (block_width, (gint) floor (allocation->width / num_blocks));
|
||||
|
Loading…
Reference in New Issue
Block a user