Open GoogleCodeExporter opened 9 years ago
There is a related issue where an element with a border will be drawn in the
wrong place. Rather than drawing the border around the element like HTML does,
VML draws the border over the partly image.
For example, if you have a 10px border, 5px will get drawn before the image
starts, and 5px will get drawn over the image itself.
To be consistent with HTML, the background position needs to be moved across
(and down) half the border width:
It's a simple fix to your existing code.
var fillPositionX =
parseInt(this.currentStyle.backgroundPositionX.replace('px', '')) +
Math.ceil(this.currentStyle.borderLeftWidth.replace('px', '')/2);
var fillPositionY =
parseInt(this.currentStyle.backgroundPositionY.replace('px', '')) +
Math.ceil(this.currentStyle.borderTopWidth.replace('px', '')/2);
There is still a problem though. CSS allows defining image position using, for
example "bottom left". I don't know how to implement this.
Original comment by thejkwhosaysni@gmail.com
on 20 Aug 2010 at 1:33
Original issue reported on code.google.com by
MageSage...@gmail.com
on 13 Aug 2010 at 12:42Attachments: