forked from FOSS/BangleApps
Layout: add support for "img" with object or ArrayBuffer Graphics object
Rendering these already worked, because we simply pass src to drawImage, so we just need to determine the correct size.master
parent
39a263c22d
commit
5972b991f9
|
@ -167,9 +167,15 @@ function updateMin(l) {
|
|||
break;
|
||||
}
|
||||
case "img": {
|
||||
var im = E.toString(l.src());
|
||||
l._h = im.charCodeAt(0);
|
||||
l._w = im.charCodeAt(1);
|
||||
var src = l.src();
|
||||
if (typeof(src) === 'object') {
|
||||
l._h = ("width" in src) ? src.width : src.getWidth();
|
||||
l._w = ("height" in src) ? src.height : src.getHeight();
|
||||
} else {
|
||||
var im = E.toString(src);
|
||||
l._h = im.charCodeAt(0);
|
||||
l._w = im.charCodeAt(1);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case undefined:
|
||||
|
|
Loading…
Reference in New Issue