View Single Post
Old 11-04-2015, 04:17 PM   #1
Thom*
The Fumbler
Thom* began at the beginning.
 
Posts: 66
Karma: 10
Join Date: Jun 2015
Device: android 4.2/fbreader
svg in file preview pane

Why is it that when I set the "svg Viewport" height above 96% that the height of the image will not fit in the file preview pane? I believe the default viewport height is 100%.

When I leave the viewport at default I get a vertical schrollbar in the preview pane. I would think that it would fit nicely just filling the pane as it does horizontally.

Code:
<body>
    <svg xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100% 100%" preserveAspectRatio="xmidymid">

    <image width="100%" height="100%" xlink:href="cover.jpeg"/>

  </svg>

</body>
When I reduce the height of the viewport to 96%, the schrollbar goes away and the the image fits into the preview pane nicely.

Code:
<body>
    <svg xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" height="96.7%" viewBox="0 0 100% 100%" preserveAspectRatio="xmidymid">

    <image width="100%" height="100%" xlink:href="cover.jpeg"/>

  </svg>

</body>
Although it is a minor issue, it just leaves me puzzled.

Last edited by Thom*; 11-04-2015 at 04:40 PM.
Thom* is offline   Reply With Quote