[Bugs] #3872 sugar-toolkit-gtk3 UNSP: CellRendererIcon has a bad clipping rectangle

Sugar Labs Bugs bugtracker-noreply at sugarlabs.org
Sat Sep 8 22:23:07 EDT 2012


#3872: CellRendererIcon has a bad clipping rectangle
------------------------------------------+---------------------------------
    Reporter:  manuq                      |          Owner:  manuq            
        Type:  defect                     |         Status:  new              
    Priority:  Unspecified by Maintainer  |      Milestone:  0.98             
   Component:  sugar-toolkit-gtk3         |        Version:  Git as of bugdate
    Severity:  Unspecified                |       Keywords:                   
Distribution:  Unspecified                |   Status_field:  Unconfirmed      
------------------------------------------+---------------------------------
 As a consequence is not being displayed correctly.  Removing the clipping
 line makes the icon appear again:

 {{{
 diff --git a/src/sugar3/graphics/icon.py b/src/sugar3/graphics/icon.py
 index f3bcb06..41e8ebb 100644
 --- a/src/sugar3/graphics/icon.py
 +++ b/src/sugar3/graphics/icon.py
 @@ -854,8 +854,6 @@ class CellRendererIcon(Gtk.CellRenderer):
          y = cell_area.y + yoffset

          cr.set_source_surface(surface, math.floor(x), math.floor(y))
 -        cr.rectangle(cell_area.x, cell_area.y, cell_area.width,
 -                     cell_area.height)
          cr.paint()
 }}}

 But the question is if we should clip the paint in GTK3 as we did in GTK2,
 and if so, how to do it.  Clipping is always better for performance.

 pygtk provided a expose_area parameter to the render method that
 [http://developer.gnome.org/pygtk/2.24/class-gtkcellrenderer.html#method-
 gtkcellrenderer--render according to the documentation] was a clip
 rectangle, and sugar was calling cr.rectangle() with it before doing the
 paint.

 [http://developer.gnome.org/gtk3/stable/GtkCellRenderer.html#gtk-cell-
 renderer-render GTK3 doesn't seem to provide that clip rectangle].  The
 documentation talks about three rectangle areas, but the API shows two and
 doesn't mention clipping.

-- 
Ticket URL: <http://bugs.sugarlabs.org/ticket/3872>
Sugar Labs <http://sugarlabs.org/>
Sugar Labs bug tracking system


More information about the Bugs mailing list