haxeui / haxeui-html5

The HTML5 backend of the HaxeUI framework -
http://haxeui.org
MIT License
28 stars 14 forks source link

Fix: Image component with border wasn't aligned correctly. #9

Closed aW4KeNiNG closed 7 years ago

aW4KeNiNG commented 7 years ago

Using the next code:

<image id="image" resource="img/image.jpg"
               width="200" height="200"
               style="border: 1px solid #000000; padding: 2px;"/>

has the result:

bughtml5

It should have 2px padding-left but it has 2px padding-left + 1px border-width.

By default, box-sizing is content-box, and it uses the border width to get in account the full size. Currently it works with another components with margin offset but it doesn't work with the Image component. With the "box-sizing=initial" value, it works.

image