Re: [whatwg] remove resetClip from the Canvas 2D spec

On Mon, Aug 12, 2013 at 2:26 PM, Justin Novosad <junov@google.com> wrote:
> Ok, so here is a simple proposal:
>
> IDL:
> enum CanvasSaveMode { "all", "transform", "clip", "transform-and-clip" };
> save(optional CanvasSaveMode mode);
>
> Modes:
> all: save the entire rendering context state
> transform: save only the current transform
> clip: save only the current clip
>
> if mode is not specified, the entire context state is saved (for backward
> compatibility)

This isn't very extensible.  You're missing some options, and if we
ever want to add more, we have to add more combination options as
well.

Better is to define a dictionary with keys of "transform" and "clip"
(+more?), whose values are bools.  Like you say, not passing the
dictionary is taken to mean "save everything".

~TJ

Received on Monday, 12 August 2013 21:33:31 UTC