Changeset 31185 in webkit


Ignore:
Timestamp:
Mar 20, 2008 2:00:24 PM (16 years ago)
Author:
alp@webkit.org
Message:

2008-03-20 Marco Barisione <marco.barisione@collabora.co.uk>

Reviewed by Alp Toker.

http://bugs.webkit.org/show_bug.cgi?id=17946
[GTK] Widgets are not clipped

  • platform/gtk/RenderThemeGtk.cpp: (WebCore::paintMozWidget): pass the clipping rectangle to moz_gtk_widget_paint() instead of just the widget rectangle.
Location:
trunk/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r31181 r31185  
     12008-03-20  Marco Barisione  <marco.barisione@collabora.co.uk>
     2
     3        Reviewed by Alp Toker.
     4
     5        http://bugs.webkit.org/show_bug.cgi?id=17946
     6        [GTK] Widgets are not clipped
     7
     8        * platform/gtk/RenderThemeGtk.cpp:
     9        (WebCore::paintMozWidget): pass the clipping rectangle to
     10        moz_gtk_widget_paint() instead of just the widget rectangle.
     11
    1122008-03-20  David Hyatt  <hyatt@apple.com>
    213
  • trunk/WebCore/platform/gtk/RenderThemeGtk.cpp

    r30029 r31185  
    22 * Copyright (C) 2007 Apple Inc.
    33 * Copyright (C) 2007 Alp Toker <alp@atoker.com>
     4 * Copyright (C) 2008 Collabora Ltd.
    45 *
    56 * This library is free software; you can redistribute it and/or
     
    156157    GtkTextDirection direction = gtkTextDirection(o->style()->direction());
    157158
    158     // FIXME: Pass the real clip region.
    159     return moz_gtk_widget_paint(type, i.context->gdkDrawable(), &gdkRect, &gdkRect, &mozState, flags, direction) != MOZ_GTK_SUCCESS;
     159    // Find the clip rectangle
     160    cairo_t *cr = i.context->platformContext();
     161    double clipX1, clipX2, clipY1, clipY2;
     162    cairo_clip_extents(cr, &clipX1, &clipY1, &clipX2, &clipY2);
     163
     164    GdkRectangle gdkClipRect;
     165    gdkClipRect.width = clipX2 - clipX1;
     166    gdkClipRect.height = clipY2 - clipY1;
     167    IntPoint clipPos = i.context->translatePoint(IntPoint(clipX1, clipY1));
     168    gdkClipRect.x = clipPos.x();
     169    gdkClipRect.y = clipPos.y();
     170
     171    gdk_rectangle_intersect(&gdkRect, &gdkClipRect, &gdkClipRect);
     172
     173    return moz_gtk_widget_paint(type, i.context->gdkDrawable(), &gdkRect, &gdkClipRect, &mozState, flags, direction) != MOZ_GTK_SUCCESS;
    160174}
    161175
Note: See TracChangeset for help on using the changeset viewer.