This SVG is drawn in Adobe Illustrator.
The art is smaller than the page.
Before saving to SVG, I hide the TEXT layer.
When the SVG is imported in InDesign, by default the bounding boxes of the frame are set to the available in the SVG, regardless of the visibility of the layers. This is good.
When the SVG is imported in Hype, by default the bounding boxes of the frame are set to the viewBox.
This is not easy then to position and scale the object. It forces the designer to always adjust, in Illustrator, the size of the page so it matches the size of the art and thus to re-edit all assets.
Once imported in Hype, a feature should allow us to choose:
Adjust to the content of the SVG,
Adjust to the bounding box of the SVG.
And to be able to choose a setting by default for all future imports.
Thanks for the request. Do you mind sending me your .ai file and the steps you are using to export it?
We do some automatic size determination that first looks at the width/height and falls back to the viewbox, but it isn't clear to me if that is the issue or it is intrinsic to how the SVG is being written out and displayed in the web view.
Sent to your email.
In AI, just Save as… SVG. That's it. There is no other option for the viewBox.
OK but I wanted to record a video tutorial about SVG where this issue will be mentioned. Do you plan to change something in the next update?
I personally am not sure if would want Hype to make that decision for me. if anything it could be an option. Given that I might be putting a bounding box on an element for a purpose. On that note, there is an Export to Hype Illustrator Version about to be released. It does just that… cut to size and some extra features. It is in private beta for a couple of weeks more, though.
Thanks - I was able to take a look. I had feared this may have been a bug, but it appears InDesign is disregarding the svg viewbox data; Hype is respecting this and interpreting the image correctly as it would be done via a web browser.
We've long wanted to have a cropping tool inside of Hype (beyond grouping with overflow:hidden), and this is a good example why. Having an Auto-crop tool that looks at the SVG shape bounds would be pretty neat, too. For that matter, doing so with a regular image that cleans up around alpha would be nifty. I've filed this feature request. It will not be for a release in the near-term. Thanks!