Bug 61876 - Add IntPoint + IntPoint operator
Summary: Add IntPoint + IntPoint operator
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Levi Weintraub
URL:
Keywords:
Depends on:
Blocks: 60318
  Show dependency treegraph
 
Reported: 2011-06-01 12:03 PDT by Levi Weintraub
Modified: 2019-05-02 16:25 PDT (History)
9 users (show)

See Also:


Attachments
Patch (2.16 KB, patch)
2011-06-01 13:49 PDT, Levi Weintraub
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Levi Weintraub 2011-06-01 12:03:00 PDT
There are a lot of places where it'd be really handy to add two IntPoints together to return an IntPoint, particularly as part of our move away from tx/ty int offsets.
Comment 1 Levi Weintraub 2011-06-01 13:49:24 PDT
Created attachment 95653 [details]
Patch
Comment 2 Hajime Morrita 2011-06-01 18:43:00 PDT
(In reply to comment #1)
> Created an attachment (id=95653) [details]
> Patch

Someone might say that adding two points doesn't make sense.
In that case, another idea is to provide IntSize IntPoint::toSize().
There is no big difference though - it's a matter of preference...
Comment 3 Emil A Eklund 2011-06-01 18:48:15 PDT
(In reply to comment #2)
> Someone might say that adding two points doesn't make sense.
> In that case, another idea is to provide IntSize IntPoint::toSize().
> There is no big difference though - it's a matter of preference...

Strictly logically speaking you're right and this isn't ideal. Given that we use IntPoint as an offset in quite a few places though it would be very convenient to allow IntPoint + IntPoint.

We already have a IntSize toSize(IntPoint) method but it adds extra overhead as it has to create a copy.
Comment 4 Hajime Morrita 2011-06-01 18:51:42 PDT
Comment on attachment 95653 [details]
Patch

Yeah, my last comment is as a logical troll ;-)
I agree that this change is convenient and has no harm.
Comment 5 Emil A Eklund 2011-06-01 18:52:27 PDT
:)
Comment 6 Levi Weintraub 2011-06-01 19:43:54 PDT
(In reply to comment #4)
> (From update of attachment 95653 [details])
> Yeah, my last comment is as a logical troll ;-)
> I agree that this change is convenient and has no harm.

Thanks for the review :)
Comment 7 WebKit Commit Bot 2011-06-01 21:51:21 PDT
Comment on attachment 95653 [details]
Patch

Clearing flags on attachment: 95653

Committed r87878: <http://trac.webkit.org/changeset/87878>
Comment 8 WebKit Commit Bot 2011-06-01 21:51:26 PDT
All reviewed patches have been landed.  Closing bug.