Rev 18608 | Rev 18615 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 18608 | Rev 18609 | ||
---|---|---|---|
Line 153... | Line 153... | ||
153 | char *rotation_center = "null";/* needs to be removed... but is used for canvas CTX based rotation*/ |
153 | char *rotation_center = "null";/* needs to be removed... but is used for canvas CTX based rotation*/ |
154 | double rotationcenter[] = {0,0}; /* use for recalculating x/y values on rotation() */ |
154 | double rotationcenter[] = {0,0}; /* use for recalculating x/y values on rotation() */ |
155 | int use_animate = 0; /* used for jscurve / js parametric */ |
155 | int use_animate = 0; /* used for jscurve / js parametric */ |
156 | int use_input_xy = 0; /* 1= input fields 2= textarea 3=calc y value*/ |
156 | int use_input_xy = 0; /* 1= input fields 2= textarea 3=calc y value*/ |
157 | size_t string_length = 0; /* measure the size of the user input fly-string */ |
157 | size_t string_length = 0; /* measure the size of the user input fly-string */ |
158 | double stroke_opacity = 0. |
158 | double stroke_opacity = 0.95; /* use some opacity as default */ |
159 | double fill_opacity = 0.5;/* use some opacity as default */ |
159 | double fill_opacity = 0.5;/* use some opacity as default */ |
160 | char *URL = "http://localhost/images"; |
160 | char *URL = "http://localhost/images"; |
161 | memset(buffer,'\0',MAX_BUFFER); |
161 | memset(buffer,'\0',MAX_BUFFER); |
162 | void *tmp_buffer = ""; |
162 | void *tmp_buffer = ""; |
163 | double res[7]; |
163 | double res[7]; |
Line 1680... | Line 1680... | ||
1680 | double_data[i] = get_real(infile,0); /* x */ |
1680 | double_data[i] = get_real(infile,0); /* x */ |
1681 | } |
1681 | } |
1682 | else { |
1682 | else { |
1683 | double_data[i] = get_real(infile,1); /* y */ |
1683 | double_data[i] = get_real(infile,1); /* y */ |
1684 | tmp_buffer=my_newmem(MAX_BUFFER); |
1684 | tmp_buffer=my_newmem(MAX_BUFFER); |
1685 | check_string_length(snprintf(tmp_buffer,MAX_BUFFER, "setTimeout(function(){filltoborder(%.*f,%.* |
1685 | check_string_length(snprintf(tmp_buffer,MAX_BUFFER, "setTimeout(function(){filltoborder(%.*f,%.*f,false,[%s,%d],%d,false,null);},1000);\n",decimals,double_data[i-1],decimals,double_data[i],fill_color,(int) (fill_opacity/0.0039215),FILL_CANVAS+fill_cnt)); |
1686 | add_to_buffer(tmp_buffer); |
1686 | add_to_buffer(tmp_buffer); |
1687 | fill_cnt++; |
1687 | fill_cnt++; |
1688 | } |
1688 | } |
1689 | i++; |
1689 | i++; |
1690 | } |
1690 | } |
Line 1771... | Line 1771... | ||
1771 | add_js_filltoborder(canvas_type); |
1771 | add_js_filltoborder(canvas_type); |
1772 | } |
1772 | } |
1773 | decimals = find_number_of_digits(precision); |
1773 | decimals = find_number_of_digits(precision); |
1774 | /* we need to set a timeout: the canvas is not yet draw in memory? when floodfill is called directly... */ |
1774 | /* we need to set a timeout: the canvas is not yet draw in memory? when floodfill is called directly... */ |
1775 | tmp_buffer=my_newmem(MAX_BUFFER); |
1775 | tmp_buffer=my_newmem(MAX_BUFFER); |
1776 | check_string_length(snprintf(tmp_buffer,MAX_BUFFER, "filltoborder(%.*f,%.*f,[%s,%d],[%s,%d],%d,false,null);\n",decimals,double_data[0],decimals,double_data[1],bgcolor,(int) (fill_opacity/0.0039215),fill_color, |
1776 | check_string_length(snprintf(tmp_buffer,MAX_BUFFER, "filltoborder(%.*f,%.*f,[%s,%d],[%s,%d],%d,false,null);\n",decimals,double_data[0],decimals,double_data[1],bgcolor,(int) (fill_opacity/0.0039215),fill_color,(int) (fill_opacity/0.0039215),FILL_CANVAS+fill_cnt)); |
1777 | add_to_buffer(tmp_buffer); |
1777 | add_to_buffer(tmp_buffer); |
1778 | fill_cnt++; |
1778 | fill_cnt++; |
1779 | reset(); |
1779 | reset(); |
1780 | break; |
1780 | break; |
1781 | default:break; |
1781 | default:break; |
Line 1804... | Line 1804... | ||
1804 | add_js_filltoborder(canvas_type); |
1804 | add_js_filltoborder(canvas_type); |
1805 | } |
1805 | } |
1806 | decimals = find_number_of_digits(precision); |
1806 | decimals = find_number_of_digits(precision); |
1807 | /* we need to set a timeout: the canvas is not yet draw in memory? when floodfill is called directly... */ |
1807 | /* we need to set a timeout: the canvas is not yet draw in memory? when floodfill is called directly... */ |
1808 | tmp_buffer=my_newmem(MAX_BUFFER); |
1808 | tmp_buffer=my_newmem(MAX_BUFFER); |
1809 | check_string_length(snprintf(tmp_buffer,MAX_BUFFER, "setTimeout(function(){filltoborder(%.*f,%.* |
1809 | check_string_length(snprintf(tmp_buffer,MAX_BUFFER, "setTimeout(function(){filltoborder(%.*f,%.*f,false,[%s,%d],%d,false,null);},1000);\n",decimals,double_data[0],decimals,double_data[1],fill_color,(int) (fill_opacity/0.0039215),FILL_CANVAS+fill_cnt)); |
1810 | add_to_buffer(tmp_buffer); |
1810 | add_to_buffer(tmp_buffer); |
1811 | fill_cnt++; |
1811 | fill_cnt++; |
1812 | break; |
1812 | break; |
1813 | default:break; |
1813 | default:break; |
1814 | } |
1814 | } |
Line 5010... | Line 5010... | ||
5010 | @%userdraw_inputs%size 400,400%xrange -10,10%yrange -10,10%grid 1,1,grey%userdraw inputs,green |
5010 | @%userdraw_inputs%size 400,400%xrange -10,10%yrange -10,10%grid 1,1,grey%userdraw inputs,green |
5011 | @%userdraw_text%size 400,400%xrange -10,10%yrange -10,10%grid 1,1,grey%fontfamily 42px Courier%userdraw text,green |
5011 | @%userdraw_text%size 400,400%xrange -10,10%yrange -10,10%grid 1,1,grey%fontfamily 42px Courier%userdraw text,green |
5012 | @%userdraw_function%size 400,400%xrange -10,10%yrange -10,10%axis%axisnumbering%precision 1%grid 2,2,grey,2,2,5,grey%multicolors orange,red,green,blue,cyan%precision 1000%userdraw functions3,red%jscurve blue,x^2,-x^2,5*cos(x)%precision 1%mouse red,22 |
5012 | @%userdraw_function%size 400,400%xrange -10,10%yrange -10,10%axis%axisnumbering%precision 1%grid 2,2,grey,2,2,5,grey%multicolors orange,red,green,blue,cyan%precision 1000%userdraw functions3,red%jscurve blue,x^2,-x^2,5*cos(x)%precision 1%mouse red,22 |
5013 | @%userdraw_clickfill_colorpalette%size 400,400%xrange -10,10%yrange -10,10%linewidth 3%circles blue,0,0,4,1,1,6,3,3,3,-3,-3,5%opacity 255,120%colorpalette red,green,yellow,blue%userdraw clickfill,green |
5013 | @%userdraw_clickfill_colorpalette%size 400,400%xrange -10,10%yrange -10,10%linewidth 3%circles blue,0,0,4,1,1,6,3,3,3,-3,-3,5%opacity 255,120%colorpalette red,green,yellow,blue%userdraw clickfill,green |
5014 | @%userdraw_clickfill_1%size 400,400%xrange -10,10%yrange -10,10%linewidth 3%circles blue,0,0,4,1,1,6,3,3,3,-3,-3,5%opacity 255,120%userdraw clickfill,green |
5014 | @%userdraw_clickfill_1%size 400,400%xrange -10,10%yrange -10,10%linewidth 3%circles blue,0,0,4,1,1,6,3,3,3,-3,-3,5%opacity 255,120%userdraw clickfill,green |
5015 | @%userdraw_clickfill_2%size 400,400%xrange -10,10%yrange - |
5015 | @%userdraw_clickfill_2%size 400,400%xrange -10,10%yrange -10,10%circles blue,0,0,2,1,1,5,5,5,4,-5,5,6,5,-5,6%userdraw hatchfill,red%#userdraw dotfill,red%#userdraw diamondfill,red%#userdraw gridfill,red |
5016 | @%userdraw_clickfill_2%size 400,400%xrange -10,10%yrange -10,10%bgcolor white%# to get nice click coordinates take invisible ''grid`` and use ''snaptogrid`` %grid 1,1,white%snaptogrid%circles blue,0,0,2,1,1,5,5,5,4,-5,5,6,5,-5,6%userdraw gridfill,red |
5016 | @%userdraw_clickfill_2%size 400,400%xrange -10,10%yrange -10,10%bgcolor white%# to get nice click coordinates take invisible ''grid`` and use ''snaptogrid`` %grid 1,1,white%snaptogrid%circles blue,0,0,2,1,1,5,5,5,4,-5,5,6,5,-5,6%userdraw gridfill,red |
5017 | */ |
5017 | */ |
5018 | if( use_userdraw != 0 ){ /* only one object type may be drawn*/ |
5018 | if( use_userdraw != 0 ){ /* only one object type may be drawn*/ |
5019 | canvas_error("Only one userdraw primitive may be used in command 'userdraw' use command 'multidraw' for this..."); |
5019 | canvas_error("Only one userdraw primitive may be used in command 'userdraw' use command 'multidraw' for this..."); |
5020 | } |
5020 | } |