Changeset 80554 in webkit


Ignore:
Timestamp:
Mar 8, 2011 2:00:38 AM (13 years ago)
Author:
Carlos Garcia Campos
Message:

2011-03-08 Carlos Garcia Campos <cgarcia@igalia.com>

Reviewed by Martin Robinson.

[GTK] Use doubles instead of integers for coordinates when rendering arrows
https://bugs.webkit.org/show_bug.cgi?id=55866

To prevent off-by-one rounding errors.

  • platform/gtk/RenderThemeGtk3.cpp: (WebCore::RenderThemeGtk::paintMenuList):
  • platform/gtk/ScrollbarThemeGtk3.cpp: (WebCore::ScrollbarThemeGtk::paintButton):
Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r80551 r80554  
     12011-03-08  Carlos Garcia Campos  <cgarcia@igalia.com>
     2
     3        Reviewed by Martin Robinson.
     4
     5        [GTK] Use doubles instead of integers for coordinates when rendering arrows
     6        https://bugs.webkit.org/show_bug.cgi?id=55866
     7
     8        To prevent off-by-one rounding errors.
     9
     10        * platform/gtk/RenderThemeGtk3.cpp:
     11        (WebCore::RenderThemeGtk::paintMenuList):
     12        * platform/gtk/ScrollbarThemeGtk3.cpp:
     13        (WebCore::ScrollbarThemeGtk::paintButton):
     14
    1152011-03-08  Markus Goetz  <guruz@guruz.de>
    216
  • trunk/Source/WebCore/platform/gtk/RenderThemeGtk3.cpp

    r77405 r80554  
    484484
    485485    IntSize arrowSize(minArrowSize, innerRect.height());
    486     IntPoint arrowPosition = innerRect.location();
     486    FloatPoint arrowPosition(innerRect.location());
    487487    if (direction == GTK_TEXT_DIR_LTR)
    488488        arrowPosition.move(innerRect.width() - arrowSize.width(), 0);
     
    491491    // don't have a widget here, we are just using the default xalign and valign values of 0.5.
    492492    gint extent = std::min(arrowSize.width(), arrowSize.height()) * arrowScaling;
    493     arrowPosition.move(std::floor((arrowSize.width() - extent) / 2), std::floor((arrowSize.height() - extent) / 2));
     493    arrowPosition.move((arrowSize.width() - extent) / 2, (arrowSize.height() - extent) / 2);
    494494
    495495    gtk_style_context_set_state(arrowStyleContext, state);
  • trunk/Source/WebCore/platform/gtk/ScrollbarThemeGtk3.cpp

    r75259 r80554  
    168168    IntSize arrowSize = rect.size();
    169169    arrowSize.scale(arrowScaling);
    170     IntPoint arrowPoint(rect.x() + (rect.width() - arrowSize.width()) / 2,
    171                         rect.y() + (rect.height() - arrowSize.height()) / 2);
     170    FloatPoint arrowPoint(rect.x() + (rect.width() - arrowSize.width()) / 2,
     171                          rect.y() + (rect.height() - arrowSize.height()) / 2);
    172172
    173173    if (flags & GTK_STATE_FLAG_ACTIVE) {
Note: See TracChangeset for help on using the changeset viewer.