Changeset 19850


Ignore:
Timestamp:
12/01/15 22:54:24 (9 years ago)
Author:
dlcheng
Message:

CHG: Fixing colorbarcanvasid handling for labelsw

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/m/plot/applyoptions.js

    r19849 r19850  
    147147                        ccanvas=document.getElementById(ccanvasid);
    148148                        if(ccanvas==null){
    149                                 ccanvas = $('<canvas id="'+ccanvasid+' width="'+String(cwidth*4)+'" height="'+String(cheight+cheightoffset)+'"></canvas>').insertAfter('#'+options.getfieldvalue('canvasid'));
    150                                 ccanvas.css({'display':'inline-block','position':'relative','top':((canvassize-cheight-cheightoffset)/-2).toFixed(2)+'px'});
     149                                ccanvas = $('<canvas id="'+ccanvasid+'" width="'+String(cwidth+cheightoffset*4)+'" height="'+String(cheight+cheightoffset)+'"></canvas>').insertAfter('#'+options.getfieldvalue('canvasid'));
     150                                ccanvas.css({'position':'relative','top':((canvassize-cheight-cheightoffset)/-2).toFixed(2)+'px'});
    151151                                ccontext = ccanvas[0].getContext('2d');
    152152                        }
     
    154154                                ccanvas = $('#'+ccanvasid);
    155155                                if (options.exist('colorbarcanvasid')){
     156                                        //store actual colobar size
    156157                                        cheight=ccanvas.height();
    157                                         cwidth=ccanvas.width();
     158                                        cwidth=ccanvas.width();
     159                                        //get html object instead of jqurey object to modify height/width to accomodate labels
     160                                        document.getElementById(ccanvasid).width=ccanvas.width()+cheightoffset*6;
     161                                        document.getElementById(ccanvasid).width=ccanvas.height()+cheightoffset;
    158162                                }
    159                                 ccanvas.css({'display':'inline-block','position':'relative','top':((canvassize-cheight-cheightoffset)/-2).toFixed(2)+'px'});
    160163                                ccontext = ccanvas[0].getContext('2d');
    161164                                /*erase existing colorbar:*/
Note: See TracChangeset for help on using the changeset viewer.