Changeset 506

Show
Ignore:
Timestamp:
03/12/08 16:54:39 (8 months ago)
Author:
bjourne
Message:

Workaround for #80925

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • gtkimageview/src/gtkimageview.c

    r474 r506  
    518518    if (!paint_rect->width || !paint_rect->height) 
    519519        return FALSE; 
     520 
     521    // This is a workaround for #80925. If the image area gets to 
     522    // small, then gdk-pixbuf's scale matrix becomes ridiculously 
     523    // large which causes noticable and wasteful cpu spikes. 
     524    Size alloc = gtk_image_view_get_allocated_size (view); 
     525    if (alloc.width <= 1 || alloc.height <= 1) 
     526        return FALSE; 
     527     
    520528    view->is_rendering = TRUE; 
    521  
     529     
    522530    // Image area is the area on the widget occupied by the pixbuf.  
    523531    GdkRectangle image_area; 
    524532    gtk_image_view_get_draw_rect (view, &image_area); 
    525     Size alloc = gtk_image_view_get_allocated_size (view); 
    526533    if (image_area.x > 0 || 
    527534        image_area.y > 0 ||