W3C home > Mailing lists > Public > www-svg@w3.org > May 2014

Random thought: patternUnits="objectBoundingWidth"

From: Paul LeBeau <paul.lebeau@gmail.com>
Date: Fri, 23 May 2014 03:02:57 +1200
Message-ID: <CACfsppByAMoVm=BYLFitt66gLoppAg4TDPYUVWXndudnU+22uQ@mail.gmail.com>
To: www-svg <www-svg@w3.org>
Hi all

I have been wondering if, in addition to "objectBoundingBox", it might be
useful if there were the options "objectBoundingWidth" and
"objectBoundingHeight".  This would allow patterns, gradients, clipPaths
etc to be described in terms of the object's width or height.

At present, patterns defined in terms of objectBoundingBox will stretch and
squash if the object shape changes.  Having a way to fix the pattern aspect
ratio may be useful, for example, in SVGs used in responsive web designs.

Example 1: A square grid pattern that has exactly 10 squares across.
Example 2: A circular gradient the height of the object centred in the
object.

Paul

PS. As always, apologies if this idea has come up before.
Received on Thursday, 22 May 2014 15:03:44 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:54:53 UTC