Subversion Repositories wimsdev

Rev

Rev 15662 | Rev 15665 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 15662 Rev 15663
Line 919... Line 919...
919
  {
919
  {
920
   fprintf(js_include_file,"userdraw_primitive = %d;",u);
920
   fprintf(js_include_file,"userdraw_primitive = %d;",u);
921
  }
921
  }
922
  break;
922
  break;
923
  /* images : identical ! to userdraw images,bogus_color */
923
  /* images : identical ! to userdraw images,bogus_color */
924
  /* 14/1/2021 remove counter in draw_mathml_div() to adres OEF multidraw anstype issue
-
 
925
     var external_div_cnt=0;
-
 
926
     function draw_mathml_div(thing,id)
-
 
927
     var fix_div = document.createElement('DIV');
-
 
928
     var new_id='placed_'+external_div_cnt+'_'+id;
-
 
929
     fix_div.setAttribute('id',new_id);\
-
 
930
  */
-
 
931
  case 20:
924
  case 20:
932
  fprintf(js_include_file,"var current_id = null;function image_adjust(image,x,y){\
925
  fprintf(js_include_file,"var current_id = null;var external_div_cnt=0;function image_adjust(image,x,y){\
933
   var centered = %d;\
926
   var centered = %d;\
934
   var w = parseInt(image.width);var h = parseInt(image.height);\
927
   var w = parseInt(image.width);var h = parseInt(image.height);\
935
   switch(centered){\
928
   switch(centered){\
936
    case 0: return [x,y];break;\
929
    case 0: return [x,y];break;\
937
    case 1: return [x,parseInt(y-0.5*h)];break;\
930
    case 1: return [x,parseInt(y-0.5*h)];break;\
Line 953... Line 946...
953
   image.height = thing.height;\
946
   image.height = thing.height;\
954
   image.onload = function(){ current_id = id; };\
947
   image.onload = function(){ current_id = id; };\
955
   return;\
948
   return;\
956
  };function draw_mathml_div(thing,id){\
949
  };function draw_mathml_div(thing,id){\
957
   var fix_div = document.createElement('DIV');\
950
   var fix_div = document.createElement('DIV');\
958
   var new_id='placed_'+id;\
951
   var new_id='placed_'+external_div_cnt+'_'+id;\
959
   fix_div.setAttribute('id',new_id);\
952
   fix_div.setAttribute('id',new_id);\
960
   var w = parseInt(thing.clientWidth);\
953
   var w = parseInt(thing.clientWidth);\
961
   var h = parseInt(thing.clientHeight);\
954
   var h = parseInt(thing.clientHeight);\
962
   fix_div.innerHTML = thing.innerHTML;\
955
   fix_div.innerHTML = thing.innerHTML;\
963
   fix_div.setAttribute('style','display:none;position;absolute;width:'+w+'px;height:'+h+'px');\
956
   fix_div.setAttribute('style','display:none;position;absolute;width:'+w+'px;height:'+h+'px');\
964
   fix_div.width = w;fix_div.height = h;\
957
   fix_div.width = w;fix_div.height = h;\
965
   canvas_div.appendChild(fix_div);\
958
   canvas_div.appendChild(fix_div);\
966
   current_id = new_id;\
959
   current_id = new_id;\
-
 
960
   external_div_cnt++;\
967
   return;\
961
   return;\
968
  };function draw_mathml_svg(thing,id){\
962
  };function draw_mathml_svg(thing,id){\
969
   var fix_div = document.createElement('DIV');\
963
   var fix_div = document.createElement('DIV');\
970
   fix_div.setAttribute('style','display:none;position;relative');\
964
   fix_div.setAttribute('style','display:none;position;relative');\
971
   canvas_div.appendChild(fix_div);\
965
   canvas_div.appendChild(fix_div);\