MCPcopy Create free account
hub / github.com/microsoft/SandDance / getImage

Function getImage

docs/app/js/sanddance-app.js:122647–122661  ·  view source on GitHub ↗
(item, renderer)

Source from the content-addressed store, hash-verified

122645 "version": "1.1"
122646};
122647function getImage(item, renderer) {
122648 var image2 = item.image;
122649 if (!image2 || item.url && item.url !== image2.url) {
122650 image2 = {
122651 complete: false,
122652 width: 0,
122653 height: 0
122654 };
122655 renderer.loadImage(item.url).then((image3)=>{
122656 item.image = image3;
122657 item.image.url = item.url;
122658 });
122659 }
122660 return image2;
122661}
122662function imageWidth(item, image4) {
122663 return item.width != null ? item.width : !image4 || !image4.width ? 0 : item.aspect !== false && item.height ? item.height * image4.width / image4.height : image4.width;
122664}

Callers 2

attr$4Function · 0.70
draw$3Function · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected