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:
		@ -508,6 +508,9 @@ gtk_level_bar_allocate_trough_discrete (GtkLevelBar *self,
 | 
				
			|||||||
  gtk_level_bar_get_min_block_size (self, &block_width, &block_height);
 | 
					  gtk_level_bar_get_min_block_size (self, &block_width, &block_height);
 | 
				
			||||||
  num_blocks = gtk_level_bar_get_num_blocks (self);
 | 
					  num_blocks = gtk_level_bar_get_num_blocks (self);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  if (num_blocks == 0)
 | 
				
			||||||
 | 
					    return;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  if (self->priv->orientation == GTK_ORIENTATION_HORIZONTAL)
 | 
					  if (self->priv->orientation == GTK_ORIENTATION_HORIZONTAL)
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
      block_width = MAX (block_width, (gint) floor (allocation->width / num_blocks));
 | 
					      block_width = MAX (block_width, (gint) floor (allocation->width / num_blocks));
 | 
				
			||||||
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user