Changeset 51

Show
Ignore:
Timestamp:
06/21/08 00:10:16 (5 months ago)
Author:
bi..@lilyapp.org
Message:

fix bug where images in procesingjs were not loading when part of an addon

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/lily/lily/chrome/content/lib/processing.js

    r46 r51  
    528528  { 
    529529    var canvas = p.lily.document.createElement("canvas"); //FIX ME ***** 
     530        canvas = (canvas.wrappedJSObject) ? canvas.wrappedJSObject : canvas; 
    530531    var ret = buildProcessing( canvas ); 
    531532    ret.size( w, h ); 
     
    574575 
    575576    var canvas = p.lily.document.createElement("canvas"); //FIX ME  *** 
     577        canvas = (canvas.wrappedJSObject) ? canvas.wrappedJSObject : canvas; 
    576578    canvas.width = img.width; 
    577579    canvas.height = img.height; 
     
    643645        var img = null; 
    644646        function processData(data){ 
    645                  
     647                                
    646648                //remove any dupes FIXME **** 
    647649                if(p.lily.document.getElementById(file)) { 
     
    657659                img.id = orgName; 
    658660                img = div.appendChild(img); 
     661                img = (img.wrappedJSObject) ? img.wrappedJSObject : img; 
     662                 
    659663        } 
    660          
     664                
    661665        //synchronous 
    662666        var xhr = new LilyUtils._xhr(processData,"bin",this,"GET",false); 
     
    670674 
    671675    var canvas = p.lily.document.createElement("canvas"); //FIX ME **** 
     676        canvas = (canvas.wrappedJSObject) ? canvas.wrappedJSObject : canvas; 
    672677    canvas.width = w; 
    673678    canvas.height = h; 
     679 
    674680    var context = canvas.getContext("2d"); 
    675  
     681        context = (context.wrappedJSObject) ? context.wrappedJSObject : context; 
    676682    context.drawImage( img, 0, 0 ); 
    677683    var data = buildImageObject( context.getImageData( 0, 0, w, h ) ); 
     684 
    678685    data.img = img; 
    679686    return data;