function finishSet(loaded, elem, css, cb) {
    // Only flip the src if the last requested image is the same as
    // the one we have now finished loading: otherwise, there has been
    // some subsequent load that has now superceded ours.
    if (elem.getAttribute('data-loading') == loaded.src) {
      elem.removeAttribute('data-loading');
      // Read the element's origin before setting the image src.
      var oldOrigin = readTransformOrigin(elem);
      // Set the image to a 1x1 transparent GIF, and clear the transform origin.
      // (This "reset" code was original added in an effort to avoid browser
      // bugs, but it is not clear if it is still needed.)
      elem.src = 'data:image/gif;base64,R0lGODlhAQABAIAAA' +
                 'AAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7';
      var sel = $(elem);
      sel.css({
        backgroundImage: 'none',
        height: '',
        width: '',
        transformOrigin: ''
      });
      // Now set the source, and then apply any css requested.
      sel[0].width = loaded.width;
      sel[0].height = loaded.height;
      sel[0].src = loaded.src;
      if (css) {
        sel.css(css);
      }
      var newOrigin = readTransformOrigin(elem);
      // If there was a change, then translate the element to keep the origin
      // in the same location on the screen.
      if (newOrigin[0] != oldOrigin[0] || newOrigin[1] != oldOrigin[1]) {
        var ts = readTurtleTransform(elem, true);
        ts.tx += oldOrigin[0] - newOrigin[0];
        ts.ty += oldOrigin[1] - newOrigin[1];
        elem.style[transform] = writeTurtleTransform(ts);
      }
    }
    // Call the callback, if any.
    if (cb) {
      cb();
    }
  }
// the parameter "loaded" contains the fully loaded Image.
the parameter "loaded" contains the fully loaded Image.
the parameter " loaded " contains the fully loaded Image .
function finishSet(loaded, elem, css, cb) {
    if (elem.getAttribute('data-loading') == loaded.src) {
      elem.removeAttribute('data-loading');
      var oldOrigin = readTransformOrigin(elem);
      elem.src = 'data:image/gif;base64,R0lGODlhAQABAIAAA' +
                 'AAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7';
      var sel = $(elem);
      sel.css({
        backgroundImage: 'none',
        height: '',
        width: '',
        transformOrigin: ''
      });
      sel[0].width = loaded.width;
      sel[0].height = loaded.height;
      sel[0].src = loaded.src;
      if (css) {
        sel.css(css);
      }
      var newOrigin = readTransformOrigin(elem);
      if (newOrigin[0] != oldOrigin[0] || newOrigin[1] != oldOrigin[1]) {
        var ts = readTurtleTransform(elem, true);
        ts.tx += oldOrigin[0] - newOrigin[0];
        ts.ty += oldOrigin[1] - newOrigin[1];
        elem.style[transform] = writeTurtleTransform(ts);
      }
    }
    if (cb) {
      cb();
    }
  }
function finishSet ( loaded , elem , css , cb ) { if ( elem . getAttribute ( 'data-loading' ) == loaded . src ) { elem . removeAttribute ( 'data-loading' ) ; var oldOrigin = readTransformOrigin ( elem ) ; elem . src = 'data:image/gif;base64,R0lGODlhAQABAIAAA' + 'AAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7' ; var sel = $ ( elem ) ; sel . css ( { backgroundImage : 'none' , height : '' , width : '' , transformOrigin : '' } ) ; sel [ 0 ] . width = loaded . width ; sel [ 0 ] . height = loaded . height ; sel [ 0 ] . src = loaded . src ; if ( css ) { sel . css ( css ) ; } var newOrigin = readTransformOrigin ( elem ) ; if ( newOrigin [ 0 ] != oldOrigin [ 0 ] || newOrigin [ 1 ] != oldOrigin [ 1 ] ) { var ts = readTurtleTransform ( elem , true ) ; ts . tx += oldOrigin [ 0 ] - newOrigin [ 0 ] ; ts . ty += oldOrigin [ 1 ] - newOrigin [ 1 ] ; elem . style [ transform ] = writeTurtleTransform ( ts ) ; } } if ( cb ) { cb ( ) ; } }
the parameter "loaded" contains the fully loaded Image.
the parameter " loaded " contains the fully loaded Image .
// Only flip the src if the last requested image is the same as // the one we have now finished loading: otherwise, there has been // some subsequent load that has now superceded ours. // Read the element's origin before setting the image src. // Set the image to a 1x1 transparent GIF, and clear the transform origin. // (This "reset" code was original added in an effort to avoid browser // bugs, but it is not clear if it is still needed.) // Now set the source, and then apply any css requested. // If there was a change, then translate the element to keep the origin // in the same location on the screen. // Call the callback, if any.