Quantcast
Channel: HTML Renderer
Viewing all articles
Browse latest Browse all 693

New Post: Images are incorrect size

$
0
0
Thank you. I have found several other issues you may want to look as I was trying to get this to work.

Detailed below:
CSSLayEngine line 268:
Images appear to have words and are not handled correctly. I added a check FlowBox if an image.

In general this code does not handle other measurement units very well. I made a couple of changes more are necessary. I think it is good to normalize on pixels as you have started to do.

In CSSLengeth I added, this would need to be completed for other units
public int GetLengthInPX()
    {
        switch (_unit)
        {
            case CssUnit.Milimeters:
                return (int)(_number*3.78f);
        }
        return 0;
    }
This is used in CssLayoutEngineTable on line354:
If it is not a percentage use the normalized pixel size. This type of change probably needs to be applied in other areas.

CssValueParser I modified IsValidLength to handle non int as needed for other units:
line 47 and 48:
float stub;
return float.TryParse(number, out stub);

also modified line 152 mm to pixel is 3.78 factor
factor = 3.78f; //3.78 pixels per millimeter

Viewing all articles
Browse latest Browse all 693

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>