1
0
Fork 0

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
Richard de Boer 2021-09-05 20:42:36 +02:00
parent 39a263c22d
commit 5972b991f9
1 changed files with 9 additions and 3 deletions

View File

@ -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: