contao/imagine-svg

Deprecate UndefinedBox and RelativeBox

ausi opened this issue · 4 comments

ausi commented

I think we should deprecate the following interfaces and classes:

  • UndefinedBoxInterface
  • RelativeBoxInterface
  • UndefinedBox
  • RelativeBox

And instead add an SvgBox with the methods isUndefined and isRelative. An interface for this class is not needed IMO.

Also getWidth() and getHeight() should probably throw an exception for an undefined box instead of returning zero.

ausi commented

Or instead of isUndefined() and isRelative() a getSvgType() method that returns TYPE_EXACT, TYPE_RELATIVE or TYPE_UNDEFINED.

I should probably look up how these terms are called in the SVG spec.

ausi commented

Also getWidth() and getHeight() should probably throw an exception for an undefined box instead of returning zero.

Probably better to return the default object size of 300 by 150

I should probably look up how these terms are called in the SVG spec.

From the SVG spec I think the naming should be TYPE_ABSOLUTE, TYPE_ASPECT_RATIO and TYPE_NONE.

+1 for default object size instead of exception.

ausi commented

Closed in favor of #14