Merge pull request #798 from rigrig/layout-img-object
Layout: add support for "img" with object or ArrayBuffer Graphics objectmaster
commit
50ec8d970e
|
|
@ -308,9 +308,15 @@ Layout.prototype.update = function() {
|
||||||
l._h = 24;
|
l._h = 24;
|
||||||
l._w = 14 + l.label.length*8;
|
l._w = 14 + l.label.length*8;
|
||||||
}, "img": function(l) {
|
}, "img": function(l) {
|
||||||
var im = E.toString(l.src());
|
var src = l.src();
|
||||||
l._h = im.charCodeAt(0);
|
if (typeof(src) === 'object') {
|
||||||
l._w = im.charCodeAt(1);
|
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);
|
||||||
|
}
|
||||||
}, "": function(l) {
|
}, "": function(l) {
|
||||||
// size should already be set up in width/height
|
// size should already be set up in width/height
|
||||||
l._w = 0;
|
l._w = 0;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue