How is max-height in print calculated?

This forum is for all Flare issues related to styles, stylesheets and XML.
Post Reply
oceanclub
Sr. Propeller Head
Posts: 277
Joined: Thu Oct 10, 2013 4:45 am
Location: Dublin

How is max-height in print calculated?

Post by oceanclub »

By default, our image size in print is set to max-width = 90%. This works except for the occasional very long graphic.

So to accommodate those, I added a class style img.longfigure, with:

* max-width=auto;
* max-height=90%

This almost works as expected, except that the length of the graphic, even a very thin one, one takes up maybe 60-70% of the length of the page, leaving unused space at the end. Is this because of how max-height is being calculated?

P.
NorthEast
Master Propellus Maximus
Posts: 6365
Joined: Mon Mar 05, 2007 8:33 am

Re: How is max-height in print calculated?

Post by NorthEast »

max-width: auto is invalid as there's no auto - so I'm guessing you should use max-width: none

I don't know if that'll fix the problem; but if you currently have a max-width set on the img tag, then it'd be inherited by img.longfigure.
oceanclub
Sr. Propeller Head
Posts: 277
Joined: Thu Oct 10, 2013 4:45 am
Location: Dublin

Re: How is max-height in print calculated?

Post by oceanclub »

Dave Lee wrote:max-width: auto is invalid as there's no auto - so I'm guessing you should use max-width: none

I don't know if that'll fix the problem; but if you currently have a max-width set on the img tag, then it'd be inherited by img.longfigure.
Ah, I had thought it was auto.

I then tried:

* max-width: 90%
* max-height: 90%

Here again, the image doesn't take up the full height allocate and instead its aspect ratio is incorrect.

I then tried both "none" and "inherit" and in both cases the image disappear entirely.

In the end, I went with the not-ideal solution of a hard-coded length for print, height = 20cm.

After that I realised that using height rather than max-height made more sense. But even then, when I use:

* height: 100%;
* width: auto;

...the image only takes up part of the page, not the full length (or width).

So after much trial and error, Flare for some reason doesn't use the length of the actual page to calculate the height of the image. I'm not sure how the height is being calculated.

P/

P.
Post Reply