On Thu, Jan 3, 2013 at 11:36 AM, Shawn Singh <shawnsi...@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.

webkit-dev mailing list

Reply via email to