MCPcopy Index your code
hub / github.com/mailru/FileAPI / fn

Function fn

lib/FileAPI.Image.js:185–209  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

183 queue.inc();
184 // preload
185 var img = new window.Image, fn = function (){
186 var
187 x = over.x|0
188 , y = over.y|0
189 , w = over.w || img.width
190 , h = over.h || img.height
191 , rel = over.rel
192 ;
193
194 // center | right | left
195 x = (rel == 1 || rel == 4 || rel == 7) ? (dw - w + x)/2 : (rel == 2 || rel == 5 || rel == 8 ? dw - (w + x) : x);
196
197 // center | bottom | top
198 y = (rel == 3 || rel == 4 || rel == 5) ? (dh - h + y)/2 : (rel >= 6 ? dh - (h + y) : y);
199
200 api.event.off(img, 'error load abort', fn);
201
202 try {
203 ctx.globalAlpha = over.opacity || 1;
204 ctx.drawImage(img, x, y, w, h);
205 }
206 catch (er){}
207
208 queue.next();
209 };
210
211 api.event.on(img, 'error load abort', fn);
212 img.src = over.src;

Callers 15

FileAPI.Flash.jsFile · 0.85
_makeFlashImageFunction · 0.85
FileAPI.Image.jsFile · 0.85
_transformFunction · 0.85
_convertFileFunction · 0.85
_oneFunction · 0.85
FileAPI.core.jsFile · 0.85
_emitFunction · 0.85
loadImageFunction · 0.85
FileAPI.id3.jsFile · 0.85
addDomLoadEventFunction · 0.85
addLoadEventFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected