[Webkit-unassigned] [Bug 28125] [Haiku] Adding ScrollbarTheme to WebCore.

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sun Aug 9 08:00:42 PDT 2009


https://bugs.webkit.org/show_bug.cgi?id=28125


Eric Seidel <eric at webkit.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #34410|review?                     |review+
               Flag|                            |




--- Comment #2 from Eric Seidel <eric at webkit.org>  2009-08-09 08:00:41 PDT ---
(From update of attachment 34410)
I would have written:
         return IntRect(scrollbar->x(), scrollbar->y(),
 77                        scrollbar->width() < 2 * thickness ?
scrollbar->width() / 2 : thickness, thickness);
 78     return IntRect(scrollbar->x(), scrollbar->y(),
 79                    thickness, scrollbar->height() < 2 * thickness ?
scrollbar->height() / 2 : thickness);

As:

int buttonWidth(int scrollbarWidth, int thickness)
{
      return scrollbarWidth < 2 * thickness ? scrollbarWidth / 2 : thickness;
}

IntPoint buttonOrigin(scrollbar->x(), scrollbar->y());
IntSize buttonSize = scrollbar->orientation() == HorizontalScrollbar
                                  ? IntSize(buttonWidth(scrollbar->width()),
thickness)
                                  : IntSize(thickness,
buttonWidth(scrollbar->width());
return IntRect(buttonOrigin, buttonSize);

That way you can re-use buttonWidth() on the next function too.

The code looks OK as is though.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list