Rev 18559 | Rev 18572 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 18559 | Rev 18563 | ||
---|---|---|---|
Line 1396... | Line 1396... | ||
1396 | else{ |
1396 | else{ |
1397 | if( draw_num == 53 ){js_function[DRAW_HATCHFILL] = 1;use_filled = 3;} |
1397 | if( draw_num == 53 ){js_function[DRAW_HATCHFILL] = 1;use_filled = 3;} |
1398 | else{ |
1398 | else{ |
1399 | if( draw_num == 54 ){js_function[DRAW_TEXTFILL] = 1;use_filled = 7;} |
1399 | if( draw_num == 54 ){js_function[DRAW_TEXTFILL] = 1;use_filled = 7;} |
1400 | else{ use_filled = 1;}}}}} |
1400 | else{ use_filled = 1;}}}}} |
1401 | - | ||
1402 | - | ||
1403 | - | ||
1404 | */ |
1401 | */ |
1405 | case 49 ... 54: |
1402 | case 49 ... 54: |
1406 | /* handling rare case of clickfill using a pattern instead of a single color...*/ |
1403 | /* handling rare case of clickfill using a pattern instead of a single color...*/ |
1407 | add_js_filltoborder(canvas_type); |
1404 | add_js_filltoborder(canvas_type); |
1408 | /*fprintf(stdout,"USE_FILLED = %d<br>",use_filled);*/ |
1405 | /*fprintf(stdout,"USE_FILLED = %d<br>",use_filled);*/ |
- | 1406 | tmp_buffer = my_newmem(p); |
|
1409 | switch(use_filled){ |
1407 | switch(use_filled){ |
1410 | case 1: |
1408 | case 1: |
1411 | p = 1 + snprintf(NULL,0,"var use_pattern_ctx = false;"); |
- | |
1412 | check_string_length(p); |
- | |
1413 | tmp_buffer = my_newmem(p); |
- | |
1414 | snprintf |
1409 | check_string_length(snprintf(tmp_buffer,MAX_BUFFER,"var use_pattern_ctx = false;")); |
1415 | break; |
1410 | break; |
1416 | case 2: |
1411 | case 2: |
1417 | p = 1 + snprintf(NULL,0,"draw_gridfill(%d,0,0,%d,%d,%d,'%s',%d,xsize,ysize,1);var use_pattern_ctx = true;var pattern_ctx = grid_fill_pattern;",CLICKFILL_CANVAS,5*line_width,5*line_width,line_width,fill_color,(int) (fill_opacity/0.0039215)); |
- | |
1418 | check_string_length(p); |
- | |
1419 | tmp_buffer = my_newmem(p); |
- | |
1420 | snprintf( |
1412 | check_string_length(snprintf(tmp_buffer,MAX_BUFFER,"draw_gridfill(%d,0,0,%d,%d,%d,'%s',%d,xsize,ysize,1);var use_pattern_ctx = true;var pattern_ctx = grid_fill_pattern;",CLICKFILL_CANVAS,5*line_width,5*line_width,line_width,fill_color,(int) (fill_opacity/0.0039215))); |
1421 | break; |
1413 | break; |
1422 | case 3: |
1414 | case 3: |
1423 | p = 1 + snprintf(NULL,0,"draw_hatchfill(%d,0,0,%d,%d,%d,'%s',%d,xsize,ysize,1);var use_pattern_ctx = true;var pattern_ctx = hatch_fill_pattern;",CLICKFILL_CANVAS,5*line_width,5*line_width,line_width,fill_color,(int) (fill_opacity/0.0039215)); |
- | |
1424 | check_string_length(p); |
- | |
1425 | tmp_buffer = my_newmem(p); |
- | |
1426 | snprintf(tmp_buffer, |
1415 | check_string_length(snprintf(tmp_buffer,MAX_BUFFER,"draw_hatchfill(%d,0,0,%d,%d,%d,'%s',%d,xsize,ysize,1);var use_pattern_ctx = true;var pattern_ctx = hatch_fill_pattern;",CLICKFILL_CANVAS,5*line_width,5*line_width,line_width,fill_color,(int) (fill_opacity/0.0039215))); |
1427 | break; |
1416 | break; |
1428 | case 4: |
1417 | case 4: |
1429 | p = 1 + snprintf(NULL,0,"draw_diamondfill(%d,0,0,%d,%d,%d,'%s',%d,xsize,ysize,1);var use_pattern_ctx = true;var pattern_ctx = diamond_fill_pattern;",CLICKFILL_CANVAS,5*line_width,5*line_width,line_width,fill_color,(int) (fill_opacity/0.0039215)); |
- | |
1430 | check_string_length(p); |
- | |
1431 | tmp_buffer = my_newmem(p); |
- | |
1432 | snprintf(tmp_buffer, |
1418 | check_string_length(snprintf(tmp_buffer,MAX_BUFFER,"draw_diamondfill(%d,0,0,%d,%d,%d,'%s',%d,xsize,ysize,1);var use_pattern_ctx = true;var pattern_ctx = diamond_fill_pattern;",CLICKFILL_CANVAS,5*line_width,5*line_width,line_width,fill_color,(int) (fill_opacity/0.0039215))); |
1433 | break; |
1419 | break; |
1434 | case 5: |
1420 | case 5: |
1435 | p = 1 + snprintf(NULL,0,"draw_dotfill(%d,0,0,%d,%d,%d,'%s',%d,xsize,ysize,1);var use_pattern_ctx = true;var pattern_ctx = dot_fill_pattern;",CLICKFILL_CANVAS,5*line_width,5*line_width,line_width,fill_color,(int) (fill_opacity/0.0039215)); |
- | |
1436 | check_string_length(p); |
- | |
1437 | tmp_buffer = my_newmem(p); |
- | |
1438 | snprintf(tmp_buffer, |
1421 | check_string_length(snprintf(tmp_buffer,MAX_BUFFER,"draw_dotfill(%d,0,0,%d,%d,%d,'%s',%d,xsize,ysize,1);var use_pattern_ctx = true;var pattern_ctx = dot_fill_pattern;",CLICKFILL_CANVAS,5*line_width,5*line_width,line_width,fill_color,(int) (fill_opacity/0.0039215))); |
1439 | break; |
1422 | break; |
1440 | case 6: |
1423 | case 6: |
1441 | p = 1 + snprintf(NULL,0,"draw_imagefill(%d,0,0,%d,%d,%d,'%s',%d,xsize,ysize,1);var use_pattern_ctx = true;var pattern_ctx = image_fill_pattern;",CLICKFILL_CANVAS,5*line_width,5*line_width,line_width,fill_color,(int) (fill_opacity/0.0039215)); |
- | |
1442 | check_string_length(p); |
- | |
1443 | tmp_buffer = my_newmem(p); |
- | |
1444 | snprintf(tmp_buffer, |
1424 | check_string_length(snprintf(tmp_buffer,MAX_BUFFER,"draw_imagefill(%d,0,0,%d,%d,%d,'%s',%d,xsize,ysize,1);var use_pattern_ctx = true;var pattern_ctx = image_fill_pattern;",CLICKFILL_CANVAS,5*line_width,5*line_width,line_width,fill_color,(int) (fill_opacity/0.0039215))); |
1445 | break; |
1425 | break; |
1446 | case 7: |
1426 | case 7: |
1447 | /*var draw_textfill = function(canvas_type,x0,y0,color,fontfamily,xsize,ysize,txt,use_userdraw)*/ |
1427 | /*var draw_textfill = function(canvas_type,x0,y0,color,fontfamily,xsize,ysize,txt,use_userdraw)*/ |
1448 | p = 1 + snprintf(NULL,0,"draw_textfill(%d,0,0,'%s','%s',xsize,ysize,userdraw_text_string,1);var use_pattern_ctx = true;var pattern_ctx = text_fill_pattern;",CLICKFILL_CANVAS,stroke_color,font_family); |
- | |
1449 | check_string_length(p); |
- | |
1450 | tmp_buffer = my_newmem(p); |
- | |
1451 | snprintf(tmp_buffer |
1428 | check_string_length(snprintf(tmp_buffer,MAX_BUFFER,"draw_textfill(%d,0,0,'%s','%s',xsize,ysize,userdraw_text_string,1);var use_pattern_ctx = true;var pattern_ctx = text_fill_pattern;",CLICKFILL_CANVAS,stroke_color,font_family)); |
1452 | break; |
1429 | break; |
1453 | } |
1430 | } |
1454 | add_to_buffer(tmp_buffer); |
1431 | add_to_buffer(tmp_buffer); |
1455 | 1432 | ||
1456 | fprintf(js_include_file,"function redraw_userdraw(){console.log('userdraw fill not zooming...');return;};\ |
1433 | fprintf(js_include_file,"function redraw_userdraw(){console.log('userdraw fill not zooming...');return;};\ |