[webkit-dev] Int/FloatPoint and Int/FloatSize

Peter Kasting pkasting at google.com
Thu Jan 3 12:14:29 PST 2013


On Thu, Jan 3, 2013 at 11:36 AM, Shawn Singh <shawnsingh at chromium.org>wrote:

> Cons of making a separate vector class:
>   - "offsets" are sometimes treated as relative point locations, and other
> times treated as vectors that can be added to points.  Deciding when to use
> which one could become just as confusing as using Point vs Size is right
> now.
>

Yeah, this is a real danger.  It's sort of mitigated if you have no way to
add/subtract two points, only a point and a vector, because that kind of
forces you to always use your vector class for offsets, otherwise you can't
do much with them.  However, you do still end up needing things like
"PointAtOffsetFromOrigin(const vector&)" that basically just convert a
vector directly to a point, so there is still the possibility for confusion.

PK
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-dev/attachments/20130103/0caa4501/attachment.html>


More information about the webkit-dev mailing list