Changeset 55228 in webkit


Ignore:
Timestamp:
Feb 25, 2010 3:48:30 AM (14 years ago)
Author:
tonikitoo@webkit.org
Message:

Add a convenient center() method to IntRect
https://bugs.webkit.org/show_bug.cgi?id=35346

Reviewed by Simon Fraser.
Patch by Antonio Gomes <tonikitoo@webkit.org>

As it is a convenience method, and implemention is
based on FloatRect's one, patch does not provide a
layout test.

  • platform/graphics/IntRect.h:

(WebCore::IntRect::center):

Location:
trunk/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r55227 r55228  
     12010-02-24  Antonio Gomes  <tonikitoo@webkit.org>
     2
     3        Reviewed by Simon Fraser.
     4        Patch by Antonio Gomes <tonikitoo@webkit.org>
     5
     6        Add a convenient center() method to IntRect
     7        https://bugs.webkit.org/show_bug.cgi?id=35346
     8
     9        As it is a convenience method, and implemention is
     10        based on FloatRect's one, patch does not provide a
     11        layout test.
     12
     13        * platform/graphics/IntRect.h:
     14        (WebCore::IntRect::center):
     15
    1162010-02-25  Andrey Kosyakov  <caseq@chromium.org>
    217
  • trunk/WebCore/platform/graphics/IntRect.h

    r52791 r55228  
    106106    int bottom() const { return y() + height(); }
    107107
     108    // NOTE: The result is rounded to integer values, and thus may be not the exact
     109    // center point.
     110    IntPoint center() const { return IntPoint(x() + width() / 2, y() + height() / 2); }
     111
    108112    void move(const IntSize& s) { m_location += s; }
    109113    void move(int dx, int dy) { m_location.move(dx, dy); }
Note: See TracChangeset for help on using the changeset viewer.