[webkit-dev] Int/FloatPoint and Int/FloatSize
Dana Jansens
danakj at chromium.org
Fri Jan 4 11:56:14 PST 2013
On Fri, Jan 4, 2013 at 12:15 AM, Simon Fraser <simon.fraser at apple.com>wrote:
> On Jan 3, 2013, at 7:43 PM, Steve Block wrote:
>
> > Thanks all for the detailed replies.
> >
> > I wasn't aware of the distinction made between points and vectors for
> > the purposes transforms. However, if I understand things correctly,
> > introducing a vector type could be considered separately from the
> > issue I initially raised.
> >
> > It seems that everyone is agreed that xxxSize should be used only when
> > you really want to represent a size. A good first step would be trying
> > to enforce this, such that all points and vectors are represented with
> > xxxPoint. As Shawn points out, when doing this, we need to make sure
> > that we continue to use the correct homogeneous coordinate for
> > transforms. Removing the existing subtraction operator (xxxPoint minus
> > xxxPoint returns xxxSize) might be a good place to start.
>
> I find point - point = size quite useful in general, and it seems to make
> logical sense.
>
> >
> > Introducing the concept of a vector could then be done in a second phase.
>
> What would you call this type, avoiding confusion with Vector<>?
>
In chromium we recently added such a class with the name Vector2d, to
differentiate it from std::vector.
>
> Simon
>
> _______________________________________________
> webkit-dev mailing list
> webkit-dev at lists.webkit.org
> http://lists.webkit.org/mailman/listinfo/webkit-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-dev/attachments/20130104/eb23a069/attachment.html>
More information about the webkit-dev
mailing list