Summary: | Add a convenient center() method to IntRect | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Antonio Gomes <tonikitoo> | ||||
Component: | WebCore Misc. | Assignee: | Antonio Gomes <tonikitoo> | ||||
Status: | CLOSED FIXED | ||||||
Severity: | Normal | CC: | hausmann, simon.fraser | ||||
Priority: | P2 | ||||||
Version: | 528+ (Nightly build) | ||||||
Hardware: | PC | ||||||
OS: | All | ||||||
Bug Depends on: | |||||||
Bug Blocks: | 18662 | ||||||
Attachments: |
|
Description
Antonio Gomes
2010-02-24 08:26:52 PST
Created attachment 49399 [details]
patch 0.1
Comment on attachment 49399 [details]
patch 0.1
r=me, but perhaps note in a comment that the center point suffers from rounding.
simon, would + // NOTE: The result is rounded to integer values, and thus can be not the exact + // center point. + IntPoint center() const { return IntPoint(x() + width() / 2, y() + height() / 2); } be ok ? I'd change: "can be not the exact center point" to "may not be the exact center point". (In reply to comment #4) > I'd change: "can be not the exact center point" to "may not be the exact center > point". landed in r55228 thx simon and kenneth |