File tree Expand file tree Collapse file tree 1 file changed +18
-2
lines changed Expand file tree Collapse file tree 1 file changed +18
-2
lines changed Original file line number Diff line number Diff line change 57265726
57275727 var local_bins = this . CreateDrawBins ( w , h , 0 , 0 ) ;
57285728
5729+ var foreignObject = document . createElementNS ( 'http://www.w3.org/2000/svg' , 'foreignObject' ) ;
5730+ // var body = document.createElement( 'body' );
5731+
5732+ var canvas = document . createElementNS ( "http://www.w3.org/1999/xhtml" , "canvas" ) ;
5733+
5734+ $ ( canvas ) . attr ( 'width' , w ) . attr ( 'height' , h )
5735+
5736+ // $(body).append(canvas);
5737+
5738+ $ ( foreignObject ) . attr ( "width" , w ) . attr ( "height" , h ) . append ( canvas ) ;
5739+
5740+ $ ( this . draw_g . node ( ) ) . append ( foreignObject ) ;
5741+
5742+ var ctx = canvas . getContext ( "2d" ) ;
5743+
5744+ /*
57295745 var canvas =
57305746 this.draw_g.append("foreignObject")
57315747 .attr("width", w)
57345750 .attr("width", w)
57355751 .attr("height", h)
57365752 .attr("style", "width: " + w + "px; height: "+ h + "px");
5737-
57385753 var ctx = canvas.node().getContext("2d");
5754+ */
57395755 for ( var i in local_bins ) {
57405756 var bin = local_bins [ i ] ;
57415757 ctx . fillStyle = bin . fill ;
57425758 ctx . fillRect ( bin . x , bin . y , bin . width , bin . height ) ;
57435759 }
5744-
5760+
57455761 ctx . stroke ( ) ;
57465762 }
57475763
You can’t perform that action at this time.
0 commit comments