| function HImageElement(data,globalData,comp){ |
| this.assetData = globalData.getAssetData(data.refId); |
| this.initElement(data,globalData,comp); |
| } |
| |
| extendPrototype([BaseElement,TransformElement,HBaseElement,HSolidElement,HierarchyElement,FrameElement,RenderableElement], HImageElement); |
| |
| |
| HImageElement.prototype.createContent = function(){ |
| var assetPath = this.globalData.getAssetsPath(this.assetData); |
| var img = new Image(); |
| |
| if(this.data.hasMask){ |
| this.imageElem = createNS('image'); |
| this.imageElem.setAttribute('width',this.assetData.w+"px"); |
| this.imageElem.setAttribute('height',this.assetData.h+"px"); |
| this.imageElem.setAttributeNS('http://www.w3.org/1999/xlink','href',assetPath); |
| this.layerElement.appendChild(this.imageElem); |
| this.baseElement.setAttribute('width',this.assetData.w); |
| this.baseElement.setAttribute('height',this.assetData.h); |
| } else { |
| this.layerElement.appendChild(img); |
| } |
| img.src = assetPath; |
| if(this.data.ln){ |
| this.baseElement.setAttribute('id',this.data.ln); |
| } |
| }; |