fix image width/height code
parent
c8e86dc78a
commit
c5d7a73f4f
|
|
@ -312,14 +312,17 @@ 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 src = l.src();
|
var src = l.src(); // get width and height out of image
|
||||||
if (typeof(src) === 'object') {
|
if (src[0]) {
|
||||||
l._h = ("width" in src) ? src.width : src.getWidth();
|
l._w = src[0];
|
||||||
l._w = ("height" in src) ? src.height : src.getHeight();
|
l._h = src[1];
|
||||||
|
} else if ('object'==typeof src) {
|
||||||
|
l._w = ("width" in src) ? src.width : src.getWidth();
|
||||||
|
l._h = ("height" in src) ? src.height : src.getHeight();
|
||||||
} else {
|
} else {
|
||||||
var im = E.toString(src);
|
var im = E.toString(src);
|
||||||
l._h = im.charCodeAt(0);
|
l._w = im.charCodeAt(0);
|
||||||
l._w = im.charCodeAt(1);
|
l._h = 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
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue