Re: [geometry] Cloning DOMPoint, DOMMatrix and DOMRect instances

On Dec 27, 2013, at 9:01 PM, Jarek Foksa <jarek@foksa.name> wrote:

> What will be the preferred way to clone an instance of DOMPoint, DOMMatrix and DOMRect? Will it be possible to pass an instance to a constructor in order to create a clone? For example:
> 
>  let initialPosition = new Point(100, 100);
>  let currentPosition = new Point(initialPosition);
> 
> Even if this will be possible, I think it would more convenient to have a clone() method on geometry interfaces just like there is cloneNode() on DOM Node interface:
> 
>  let initialPosition = new Point(100, 100);
>  let currentPosition = initialPosition.clone();

For now it is really just passing the object to a Ctor. Your suggestion sounds interesting though.

Greetings,
Dirk

Received on Thursday, 2 January 2014 11:57:53 UTC