svg-native-viewer icon indicating copy to clipboard operation
svg-native-viewer copied to clipboard

Default ViewBox can be misleading

Open moazin opened this issue 3 years ago • 0 comments

Right now, a default of ViewBox of 0 0 320.0 200.0 is assumed if none is provided. If Width and Height are called they would return these numbers which is wrong in my opinion. By default, no size should be assume and we should have APIs that can tell the client if an actual width, height or viewbox attribute was provided or not and if yes, it should allow them to grab those values.

Also, I think the API for rendering should be different. There should be a render function that simply renders the document to a provided canvas without doing any scaling or taking the viewBox into account at all. Then there should be another one that render the ViewBox but scale it up or down as you ask (by providing Width and Height, say).

If you agree, let's discuss the API design. @dirkschulze

moazin avatar Jul 31 '21 11:07 moazin