Subversion Repositories wimsdev

Rev

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

Rev 8127 Rev 8129
Line 2396... Line 2396...
2396
        */
2396
        */
2397
            fprintf(js_include_file,"unit_y = \"%s\";",get_string(infile,1));
2397
            fprintf(js_include_file,"unit_y = \"%s\";",get_string(infile,1));
2398
            break;
2398
            break;
2399
        case MOUSE_DISPLAY:
2399
        case MOUSE_DISPLAY:
2400
        /*
2400
        /*
2401
         @display x|y|xy|degree|,color,fontsize
2401
         @display x|y|xy|degree|radius,color,fontsize
2402
         @will display the mouse cursor coordinates as x-only,y-only,(x:y) or the angle in degrees<br />(angle between x-axis;(0:0);(x:y)
2402
         @will display the mouse cursor coordinates as x-only,y-only,(x:y),<br />the radius of a circle (this only in case 'userdraw circle(s),color' !!<br />or the angle in degrees ( rhe angle between x-axis;(0:0);(x:y)
-
 
2403
         @use commands 'xunit' and / or 'yunit' to add the units to the mouse values
2403
         @just like commands 'mouse','mousex','mousey','mouse_degree'...only other name)
2404
         @just like commands 'mouse','mousex','mousey','mouse_degree'...only other name)
2404
        */
2405
        */
2405
        temp = get_string_argument(infile,0);
2406
        temp = get_string_argument(infile,0);
2406
        if( strstr(temp,"xy") != NULL ){
2407
        if( strstr(temp,"xy") != NULL ){
2407
            int_data[0] = 2;
2408
            int_data[0] = 2;
Line 2409... Line 2410...
2409
            if( strstr(temp,"y") != NULL ){
2410
            if( strstr(temp,"y") != NULL ){
2410
                int_data[0] = 1;
2411
                int_data[0] = 1;
2411
            }else{
2412
            }else{
2412
                if( strstr(temp,"x") != NULL ){
2413
                if( strstr(temp,"x") != NULL ){
2413
                    int_data[0] = 0;
2414
                    int_data[0] = 0;
-
 
2415
                }else{
2414
                    if(strstr(temp,"degree") != NULL){
2416
                    if(strstr(temp,"degree") != NULL){
2415
                        int_data[0] = 3;
2417
                        int_data[0] = 3;
2416
                    }else{
2418
                    }else{
-
 
2419
                        if(strstr(temp,"radius") != NULL){
-
 
2420
                            int_data[0] = 4;
-
 
2421
                        }else{
2417
                        int_data[0] = 2;
2422
                            int_data[0] = 2;
-
 
2423
                        }
2418
                    }
2424
                    }
2419
                }      
2425
                }
2420
            }
2426
            }
2421
        }      
2427
        }
2422
        stroke_color = get_color(infile,0);
2428
        stroke_color = get_color(infile,0);
2423
        font_size = (int) (get_real(infile,1));
2429
        font_size = (int) (get_real(infile,1));
2424
        tmp_buffer = my_newmem(26);
2430
        tmp_buffer = my_newmem(26);
2425
        snprintf(tmp_buffer,25,"use_mouse_coordinates();\n");add_to_buffer(tmp_buffer);
2431
        snprintf(tmp_buffer,25,"use_mouse_coordinates();\n");add_to_buffer(tmp_buffer);
2426
        add_js_mouse(js_include_file,MOUSE_CANVAS,canvas_root_id,precision,stroke_color,font_size,stroke_opacity,int_data[0]);
2432
        add_js_mouse(js_include_file,MOUSE_CANVAS,canvas_root_id,precision,stroke_color,font_size,stroke_opacity,int_data[0]);
Line 5219... Line 5225...
5219
 ctx.font = fontfamily;\
5225
 ctx.font = fontfamily;\
5220
 var minor_opacity = 0.8*opacity;\
5226
 var minor_opacity = 0.8*opacity;\
5221
 ctx.clearRect(0,0,xsize,ysize);\
5227
 ctx.clearRect(0,0,xsize,ysize);\
5222
 var zero_x = 0.1*xsize;\
5228
 var zero_x = 0.1*xsize;\
5223
 var zero_y = 0.9*ysize;\
5229
 var zero_y = 0.9*ysize;\
5224
 var snor_x;\
5230
 var snor_x;var snor_y;\
5225
 if( xstart != xmin){\
5231
 if( xstart != xmin){\
5226
  snor_x = 0.1*xsize;\
5232
  snor_x = 0.1*xsize;\
5227
 }\
5233
 }\
5228
 else\
5234
 else\
5229
 {\
5235
 {\