43 #define dprintf if(DEBUG) printf
46 draw_cairo_line_to (cairo_t *cairoTarget, gdouble x, gdouble y, gboolean adjustByHalf, gboolean pixelOutput){
47 gdouble x1 = x, y1 = y;
49 cairo_user_to_device (cairoTarget, &x1, &y1);
56 cairo_device_to_user (cairoTarget, &x1, &y1);
58 cairo_line_to (cairoTarget, x1, y1);
62 draw_cairo_move_to (cairo_t *cairoTarget, gdouble x, gdouble y, gboolean oddWidth, gboolean pixelOutput){
63 gdouble x1 = x, y1 = y;
65 cairo_user_to_device (cairoTarget, &x1, &y1);
72 cairo_device_to_user (cairoTarget, &x1, &y1);
74 cairo_move_to (cairoTarget, x1, y1);
78 draw_cairo_translate_adjust (cairo_t *cairoTarget, gdouble x, gdouble y, gboolean pixelOutput){
79 gdouble x1 = x, y1 = y;
81 cairo_user_to_device (cairoTarget, &x1, &y1);
84 cairo_device_to_user (cairoTarget, &x1, &y1);
86 cairo_translate (cairoTarget, x1, y1);
93 for (i=0; i<selectionInfo->selectedNodeArray->len; i++){
94 gerbv_selection_item_t sItem = g_array_index (selectionInfo->selectedNodeArray,
95 gerbv_selection_item_t, i);
103 draw_check_if_object_is_in_selected_area (cairo_t *cairoTarget, gboolean isStroke,
105 gdouble corner1X,corner1Y,corner2X,corner2Y;
107 corner1X = selectionInfo->lowerLeftX;
108 corner1Y = selectionInfo->lowerLeftY;
109 corner2X = selectionInfo->upperRightX;
110 corner2Y = selectionInfo->upperRightY;
114 cairo_device_to_user (cairoTarget, &corner1X, &corner1Y);
115 cairo_device_to_user (cairoTarget, &corner2X, &corner2Y);
119 if ((isStroke && cairo_in_stroke (cairoTarget, corner1X, corner1Y)) ||
120 (!isStroke && cairo_in_fill (cairoTarget, corner1X, corner1Y))) {
122 if (!draw_net_in_selection_buffer(net, selectionInfo)) {
123 gerbv_selection_item_t sItem = {image, net};
124 g_array_append_val (selectionInfo->selectedNodeArray, sItem);
130 gdouble minX,minY,maxX,maxY;
134 minX = MIN(corner1X,corner2X);
135 maxX = MAX(corner1X,corner2X);
136 minY = MIN(corner1Y,corner2Y);
137 maxY = MAX(corner1Y,corner2Y);
139 cairo_stroke_extents (cairoTarget, &x1, &y1, &x2, &y2);
141 cairo_fill_extents (cairoTarget, &x1, &y1, &x2, &y2);
143 if ((minX < x1) && (minY < y1) && (maxX > x2) && (maxY > y2)) {
145 if (!draw_net_in_selection_buffer(net, selectionInfo)) {
146 gerbv_selection_item_t sItem = {image, net};
147 g_array_append_val (selectionInfo->selectedNodeArray, sItem);
153 cairo_new_path (cairoTarget);
159 if ((drawMode == DRAW_IMAGE) || (drawMode == DRAW_SELECTIONS))
160 cairo_fill (cairoTarget);
162 draw_check_if_object_is_in_selected_area (cairoTarget, FALSE,
163 selectionInfo, image, net);
169 if ((drawMode == DRAW_IMAGE) || (drawMode == DRAW_SELECTIONS))
170 cairo_stroke (cairoTarget);
172 draw_check_if_object_is_in_selected_area (cairoTarget, TRUE,
173 selectionInfo, image, net);
180 gerbv_draw_circle(cairo_t *cairoTarget, gdouble diameter)
182 cairo_arc (cairoTarget, 0.0, 0.0, diameter/2.0, 0, 2.0*M_PI);
191 gerbv_draw_rectangle(cairo_t *cairoTarget, gdouble width1, gdouble height1, gboolean pixelOutput)
193 gdouble width = width1, height = height1;
195 cairo_user_to_device_distance (cairoTarget, &width, &height);
196 width = round(width);
197 height = round(height);
198 width -= (int)width % 2;
199 height -= (int)height % 2;
200 cairo_device_to_user_distance (cairoTarget, &width, &height);
202 cairo_rectangle (cairoTarget, - width / 2.0, - height / 2.0, width, height);
211 gerbv_draw_oblong(cairo_t *cairoTarget, gdouble width, gdouble height)
214 gdouble circleDiameter, strokeDistance;
216 cairo_new_path (cairoTarget);
217 if (width < height) {
218 circleDiameter = width;
219 strokeDistance = (height - width)/2.0;
220 cairo_arc (cairoTarget, 0.0, strokeDistance, circleDiameter/2.0, 0, -M_PI);
221 cairo_line_to (cairoTarget, -circleDiameter/2.0, -strokeDistance);
222 cairo_arc (cairoTarget, 0.0, -strokeDistance, circleDiameter/2.0, -M_PI, 0);
223 cairo_line_to (cairoTarget, circleDiameter/2.0, strokeDistance);
226 circleDiameter = height;
227 strokeDistance = (width - height)/2.0;
228 cairo_arc (cairoTarget, -strokeDistance, 0.0, circleDiameter/2.0, M_PI/2.0, -M_PI/2.0);
229 cairo_line_to (cairoTarget, strokeDistance, -circleDiameter/2.0);
230 cairo_arc (cairoTarget, strokeDistance, 0.0, circleDiameter/2.0, -M_PI/2.0, M_PI/2.0);
231 cairo_line_to (cairoTarget, -strokeDistance, circleDiameter/2.0);
246 gerbv_draw_polygon(cairo_t *cairoTarget, gdouble outsideDiameter,
247 gdouble numberOfSides, gdouble degreesOfRotation)
249 int i, numberOfSidesInteger = (int) numberOfSides;
251 cairo_rotate(cairoTarget, degreesOfRotation * M_PI/180);
252 cairo_move_to(cairoTarget, outsideDiameter / 2.0, 0);
256 for (i = 1; i <= (int)numberOfSidesInteger; i++){
257 gdouble angle = (double) i / numberOfSidesInteger * M_PI * 2.0;
258 cairo_line_to (cairoTarget, cos(angle) * outsideDiameter / 2.0,
259 sin(angle) * outsideDiameter / 2.0);
266 gerbv_draw_aperature_hole(cairo_t *cairoTarget, gdouble dimensionX, gdouble dimensionY, gboolean pixelOutput)
270 gerbv_draw_rectangle (cairoTarget, dimensionX, dimensionY, pixelOutput);
272 gerbv_draw_circle (cairoTarget, dimensionX);
279 draw_update_macro_exposure (cairo_t *cairoTarget, cairo_operator_t clearOperator,
280 cairo_operator_t darkOperator, gdouble exposureSetting){
282 if (exposureSetting == 0.0) {
283 cairo_set_operator (cairoTarget, clearOperator);
285 else if (exposureSetting == 1.0) {
286 cairo_set_operator (cairoTarget, darkOperator);
288 else if (exposureSetting == 2.0) {
290 cairo_operator_t currentOperator = cairo_get_operator (cairoTarget);
291 if (currentOperator == clearOperator) {
292 cairo_set_operator (cairoTarget, darkOperator);
295 cairo_set_operator (cairoTarget, clearOperator);
303 gerbv_draw_amacro(cairo_t *cairoTarget, cairo_operator_t clearOperator,
304 cairo_operator_t darkOperator, gerbv_simplified_amacro_t *s,
305 gint usesClearPrimative, gdouble pixelWidth, gchar drawMode,
310 gerbv_simplified_amacro_t *ls = s;
312 dprintf(_(
"Drawing simplified aperture macros:\n"));
313 if (usesClearPrimative)
314 cairo_push_group (cairoTarget);
321 cairo_save (cairoTarget);
322 cairo_new_path(cairoTarget);
323 cairo_operator_t oldOperator = cairo_get_operator (cairoTarget);
327 if (draw_update_macro_exposure (cairoTarget, clearOperator,
328 darkOperator, ls->parameter[CIRCLE_EXPOSURE])){
329 cairo_translate (cairoTarget, ls->parameter[CIRCLE_CENTER_X],
330 ls->parameter[CIRCLE_CENTER_Y]);
332 gerbv_draw_circle (cairoTarget, ls->parameter[CIRCLE_DIAMETER]);
333 draw_fill (cairoTarget, drawMode, selectionInfo, image, net);
336 int pointCounter,numberOfPoints;
340 numberOfPoints = (int) ls->parameter[OUTLINE_NUMBER_OF_POINTS] + 1;
342 if (draw_update_macro_exposure (cairoTarget, clearOperator,
343 darkOperator, ls->parameter[OUTLINE_EXPOSURE])){
344 cairo_rotate (cairoTarget, ls->parameter[(numberOfPoints - 1) * 2 + OUTLINE_ROTATION] * M_PI/180.0);
345 cairo_move_to (cairoTarget, ls->parameter[OUTLINE_FIRST_X], ls->parameter[OUTLINE_FIRST_Y]);
347 for (pointCounter=0; pointCounter < numberOfPoints; pointCounter++) {
348 cairo_line_to (cairoTarget, ls->parameter[pointCounter * 2 + OUTLINE_FIRST_X],
349 ls->parameter[pointCounter * 2 + OUTLINE_FIRST_Y]);
356 draw_fill (cairoTarget, drawMode, selectionInfo, image, net);
359 if (draw_update_macro_exposure (cairoTarget, clearOperator,
360 darkOperator, ls->parameter[POLYGON_EXPOSURE])){
361 cairo_translate (cairoTarget, ls->parameter[POLYGON_CENTER_X],
362 ls->parameter[POLYGON_CENTER_Y]);
363 gerbv_draw_polygon(cairoTarget, ls->parameter[POLYGON_DIAMETER],
364 ls->parameter[POLYGON_NUMBER_OF_POINTS], ls->parameter[POLYGON_ROTATION]);
365 draw_fill (cairoTarget, drawMode, selectionInfo, image, net);
368 gdouble diameter, diameterDifference;
371 cairo_translate (cairoTarget, ls->parameter[MOIRE_CENTER_X],
372 ls->parameter[MOIRE_CENTER_Y]);
373 cairo_rotate (cairoTarget, ls->parameter[MOIRE_ROTATION] * M_PI/180);
374 diameter = ls->parameter[MOIRE_OUTSIDE_DIAMETER] - ls->parameter[MOIRE_CIRCLE_THICKNESS];
375 diameterDifference = 2*(ls->parameter[MOIRE_GAP_WIDTH] +
376 ls->parameter[MOIRE_CIRCLE_THICKNESS]);
377 cairo_set_line_width (cairoTarget, ls->parameter[MOIRE_CIRCLE_THICKNESS]);
379 for (circleIndex = 0; circleIndex < (int)ls->parameter[MOIRE_NUMBER_OF_CIRCLES]; circleIndex++) {
380 gdouble currentDiameter = diameter - diameterDifference * (float) circleIndex;
381 if (currentDiameter >= 0){
382 gerbv_draw_circle (cairoTarget, currentDiameter);
383 draw_stroke (cairoTarget, drawMode, selectionInfo, image, net);
387 gdouble crosshairRadius = ls->parameter[MOIRE_CROSSHAIR_LENGTH] / 2.0;
389 cairo_set_line_width (cairoTarget, ls->parameter[MOIRE_CROSSHAIR_THICKNESS]);
390 cairo_move_to (cairoTarget, -crosshairRadius, 0);
391 cairo_line_to (cairoTarget, crosshairRadius, 0);
392 cairo_move_to (cairoTarget, 0, -crosshairRadius);
393 cairo_line_to (cairoTarget, 0, crosshairRadius);
394 draw_stroke (cairoTarget, drawMode, selectionInfo, image, net);
397 gdouble startAngle1, startAngle2, endAngle1, endAngle2;
399 cairo_translate (cairoTarget, ls->parameter[THERMAL_CENTER_X],
400 ls->parameter[THERMAL_CENTER_Y]);
401 cairo_rotate (cairoTarget, ls->parameter[THERMAL_ROTATION] * M_PI/180.0);
402 startAngle1 = atan (ls->parameter[THERMAL_CROSSHAIR_THICKNESS]/ls->parameter[THERMAL_INSIDE_DIAMETER]);
403 endAngle1 = M_PI/2 - startAngle1;
404 endAngle2 = atan (ls->parameter[THERMAL_CROSSHAIR_THICKNESS]/ls->parameter[THERMAL_OUTSIDE_DIAMETER]);
405 startAngle2 = M_PI/2 - endAngle2;
406 for (i = 0; i < 4; i++) {
407 cairo_arc (cairoTarget, 0, 0, ls->parameter[THERMAL_INSIDE_DIAMETER]/2.0, startAngle1, endAngle1);
408 cairo_rel_line_to (cairoTarget, 0, ls->parameter[THERMAL_CROSSHAIR_THICKNESS]);
409 cairo_arc_negative (cairoTarget, 0, 0, ls->parameter[THERMAL_OUTSIDE_DIAMETER]/2.0,
410 startAngle2, endAngle2);
411 cairo_rel_line_to (cairoTarget, -ls->parameter[THERMAL_CROSSHAIR_THICKNESS],0);
412 draw_fill (cairoTarget, drawMode, selectionInfo, image, net);
413 cairo_rotate (cairoTarget, 90 * M_PI/180);
416 if (draw_update_macro_exposure (cairoTarget, clearOperator,
417 darkOperator, ls->parameter[LINE20_EXPOSURE])){
418 gdouble cParameter = ls->parameter[LINE20_LINE_WIDTH];
419 if (cParameter < pixelWidth)
420 cParameter = pixelWidth;
422 cairo_set_line_width (cairoTarget, cParameter);
423 cairo_set_line_cap (cairoTarget, CAIRO_LINE_CAP_BUTT);
424 cairo_rotate (cairoTarget, ls->parameter[LINE20_ROTATION] * M_PI/180.0);
425 cairo_move_to (cairoTarget, ls->parameter[LINE20_START_X], ls->parameter[LINE20_START_Y]);
426 cairo_line_to (cairoTarget, ls->parameter[LINE20_END_X], ls->parameter[LINE20_END_Y]);
427 draw_stroke (cairoTarget, drawMode, selectionInfo, image, net);
430 gdouble halfWidth, halfHeight;
432 if (draw_update_macro_exposure (cairoTarget, clearOperator,
433 darkOperator, ls->parameter[LINE22_EXPOSURE])){
434 halfWidth = ls->parameter[LINE21_WIDTH] / 2.0;
435 halfHeight = ls->parameter[LINE21_HEIGHT] / 2.0;
436 if (halfWidth < pixelWidth)
437 halfWidth = pixelWidth;
438 if (halfHeight < pixelWidth)
439 halfHeight = pixelWidth;
440 cairo_translate (cairoTarget, ls->parameter[LINE21_CENTER_X], ls->parameter[LINE21_CENTER_Y]);
441 cairo_rotate (cairoTarget, ls->parameter[LINE21_ROTATION] * M_PI/180.0);
442 cairo_rectangle (cairoTarget, -halfWidth, -halfHeight,
443 ls->parameter[LINE21_WIDTH], ls->parameter[LINE21_HEIGHT]);
444 draw_fill (cairoTarget, drawMode, selectionInfo, image, net);
447 gdouble halfWidth, halfHeight;
449 if (draw_update_macro_exposure (cairoTarget, clearOperator,
450 darkOperator, ls->parameter[LINE22_EXPOSURE])){
451 halfWidth = ls->parameter[LINE22_WIDTH] / 2.0;
452 halfHeight = ls->parameter[LINE22_HEIGHT] / 2.0;
453 if (halfWidth < pixelWidth)
454 halfWidth = pixelWidth;
455 if (halfHeight < pixelWidth)
456 halfHeight = pixelWidth;
457 cairo_translate (cairoTarget, ls->parameter[LINE22_LOWER_LEFT_X],
458 ls->parameter[LINE22_LOWER_LEFT_Y]);
459 cairo_rotate (cairoTarget, ls->parameter[LINE22_ROTATION] * M_PI/180.0);
460 cairo_rectangle (cairoTarget, 0, 0,
461 ls->parameter[LINE22_WIDTH], ls->parameter[LINE22_HEIGHT]);
462 draw_fill (cairoTarget, drawMode, selectionInfo, image, net);
467 cairo_set_operator (cairoTarget, oldOperator);
468 cairo_restore (cairoTarget);
471 if (usesClearPrimative) {
472 cairo_pop_group_to_source (cairoTarget);
473 cairo_paint (cairoTarget);
483 cairo_scale (cairoTarget, state->
scaleA, state->
scaleB);
488 case GERBV_MIRROR_STATE_FLIPA:
489 cairo_scale (cairoTarget, -1, 1);
491 case GERBV_MIRROR_STATE_FLIPB:
492 cairo_scale (cairoTarget, 1, -1);
494 case GERBV_MIRROR_STATE_FLIPAB:
495 cairo_scale (cairoTarget, -1, -1);
501 if (state->
axisSelect == GERBV_AXIS_SELECT_SWAPAB) {
504 cairo_rotate (cairoTarget, 3 * M_PI / 2);
505 cairo_scale (cairoTarget, 1, -1);
510 draw_render_polygon_object (
gerbv_net_t *oldNet, cairo_t *cairoTarget, gdouble sr_x, gdouble sr_y,
513 int haveDrawnFirstFillPoint = 0;
514 gdouble x2,y2,cp_x=0,cp_y=0;
516 haveDrawnFirstFillPoint = FALSE;
519 polygonStartNet = oldNet;
520 cairo_new_path(cairoTarget);
522 for (currentNet = oldNet->
next; currentNet!=NULL; currentNet = currentNet->
next){
523 x2 = currentNet->
stop_x + sr_x;
524 y2 = currentNet->
stop_y + sr_y;
528 cp_x = currentNet->
cirseg->cp_x + sr_x;
529 cp_y = currentNet->
cirseg->cp_y + sr_y;
531 if (!haveDrawnFirstFillPoint) {
532 draw_cairo_move_to (cairoTarget, x2, y2, FALSE, pixelOutput);
533 haveDrawnFirstFillPoint=TRUE;
541 draw_cairo_line_to (cairoTarget, x2, y2, FALSE, pixelOutput);
545 if (currentNet->
cirseg->angle2 > currentNet->
cirseg->angle1) {
546 cairo_arc (cairoTarget, cp_x, cp_y, currentNet->
cirseg->width/2.0,
547 currentNet->
cirseg->angle1 * M_PI/180,currentNet->
cirseg->angle2 * M_PI/180);
550 cairo_arc_negative (cairoTarget, cp_x, cp_y, currentNet->
cirseg->width/2.0,
551 currentNet->
cirseg->angle1 * M_PI/180,currentNet->
cirseg->angle2 * M_PI/180);
555 cairo_close_path(cairoTarget);
558 cairo_antialias_t oldAlias = cairo_get_antialias (cairoTarget);
559 cairo_set_antialias (cairoTarget, CAIRO_ANTIALIAS_NONE);
560 draw_fill (cairoTarget, drawMode, selectionInfo, image, polygonStartNet);
561 cairo_set_antialias (cairoTarget, oldAlias);
572 draw_image_to_cairo_target (cairo_t *cairoTarget,
gerbv_image_t *image,
577 struct gerbv_net *net, *polygonStartNet=NULL;
578 double x1, y1, x2, y2, cp_x=0, cp_y=0;
579 gdouble p0, p1, p2, p3, p4, dx, dy, lineWidth;
582 cairo_operator_t drawOperatorClear, drawOperatorDark;
583 gboolean invertPolarity = FALSE, oddWidth = FALSE;
584 gdouble minX=0, minY=0, maxX=0, maxY=0;
585 gdouble criticalRadius;
586 gdouble scaleX = transform.
scaleX;
587 gdouble scaleY = transform.
scaleY;
588 gboolean limitLineWidth = TRUE;
589 gboolean displayPixel = TRUE;
592 if ((scaleX != 1)||(scaleY != 1)){
593 limitLineWidth = FALSE;
601 cairo_scale (cairoTarget, scaleX, scaleY);
602 cairo_rotate (cairoTarget, transform.
rotation);
604 gboolean useOptimizations = allowOptimization;
609 (fabs(transform.
scaleX - 1) > 0.00001) ||
610 (fabs(transform.
scaleY - 1) > 0.00001) ||
611 (fabs(transform.
rotation) > 0.00001) ||
613 useOptimizations = FALSE;
615 if (useOptimizations && pixelOutput) {
625 cairo_translate (cairoTarget, image->
info->imageJustifyOffsetActualA,
626 image->
info->imageJustifyOffsetActualB);
629 cairo_set_fill_rule (cairoTarget, CAIRO_FILL_RULE_EVEN_ODD);
631 cairo_translate (cairoTarget, image->
info->offsetA, image->
info->offsetB);
633 cairo_rotate (cairoTarget, image->
info->imageRotation);
635 invertPolarity = transform.
inverted;
637 invertPolarity = !invertPolarity;
638 if (drawMode == DRAW_SELECTIONS)
639 invertPolarity = FALSE;
641 if (invertPolarity) {
642 drawOperatorClear = CAIRO_OPERATOR_OVER;
643 drawOperatorDark = CAIRO_OPERATOR_CLEAR;
644 cairo_set_operator (cairoTarget, CAIRO_OPERATOR_OVER);
645 cairo_paint (cairoTarget);
646 cairo_set_operator (cairoTarget, CAIRO_OPERATOR_CLEAR);
649 drawOperatorClear = CAIRO_OPERATOR_CLEAR;
650 drawOperatorDark = CAIRO_OPERATOR_OVER;
656 cairo_save (cairoTarget);
657 cairo_save (cairoTarget);
665 if (net->
layer != oldLayer){
668 cairo_restore (cairoTarget);
669 cairo_restore (cairoTarget);
670 cairo_save (cairoTarget);
675 cairo_set_operator (cairoTarget, CAIRO_OPERATOR_CLEAR);
676 drawOperatorClear = CAIRO_OPERATOR_OVER;
677 drawOperatorDark = CAIRO_OPERATOR_CLEAR;
680 cairo_set_operator (cairoTarget, CAIRO_OPERATOR_OVER);
681 drawOperatorClear = CAIRO_OPERATOR_CLEAR;
682 drawOperatorDark = CAIRO_OPERATOR_OVER;
686 cairo_operator_t oldOperator = cairo_get_operator (cairoTarget);
688 cairo_set_operator (cairoTarget, drawOperatorClear);
691 cairo_set_operator (cairoTarget, drawOperatorDark);
693 cairo_new_path (cairoTarget);
698 draw_fill (cairoTarget, drawMode, selectionInfo, image, net);
699 cairo_set_operator (cairoTarget, oldOperator);
702 cairo_save (cairoTarget);
703 draw_apply_netstate_transformation (cairoTarget, net->
state);
704 oldLayer = net->
layer;
707 if (net->
state != oldState){
710 cairo_restore (cairoTarget);
711 cairo_save (cairoTarget);
714 draw_apply_netstate_transformation (cairoTarget, net->
state);
715 oldState = net->
state;
719 if (drawMode == DRAW_SELECTIONS) {
724 if (!polygonStartNet) {
725 if (!draw_net_in_selection_buffer(net, selectionInfo))
737 if ((useOptimizations && pixelOutput) &&
752 cp_x = net->
cirseg->cp_x + sr_x;
753 cp_y = net->
cirseg->cp_y + sr_y;
760 cairo_set_font_size (cairoTarget, 0.05);
761 cairo_save (cairoTarget);
763 cairo_move_to (cairoTarget, x1, y1);
764 cairo_scale (cairoTarget, 1, -1);
765 cairo_show_text (cairoTarget, net->
label->str);
766 cairo_restore (cairoTarget);
773 draw_render_polygon_object (net, cairoTarget, sr_x, sr_y, image,
774 drawMode, selectionInfo, pixelOutput);
802 if (limitLineWidth&&((image->
aperture[net->
aperture]->parameter[0] < pixelWidth)&&
804 criticalRadius = pixelWidth/2.0;
807 lineWidth = criticalRadius*2.0;
809 cairo_user_to_device_distance (cairoTarget, &lineWidth, &x1);
811 lineWidth = round(lineWidth);
812 if ((
int)lineWidth % 2) {
819 cairo_device_to_user_distance (cairoTarget, &lineWidth, &x1);
820 cairo_set_line_width (cairoTarget, lineWidth);
826 cairo_set_line_cap (cairoTarget, CAIRO_LINE_CAP_ROUND);
832 draw_cairo_move_to (cairoTarget, x1, y1, oddWidth, pixelOutput);
833 draw_cairo_line_to (cairoTarget, x2, y2, oddWidth, pixelOutput);
834 draw_stroke (cairoTarget, drawMode, selectionInfo, image, net);
843 cairo_new_path(cairoTarget);
844 draw_cairo_move_to (cairoTarget, x1 - dx, y1 - dy, FALSE, pixelOutput);
845 draw_cairo_line_to (cairoTarget, x1 - dx, y1 + dy, FALSE, pixelOutput);
846 draw_cairo_line_to (cairoTarget, x2 - dx, y2 + dy, FALSE, pixelOutput);
847 draw_cairo_line_to (cairoTarget, x2 + dx, y2 + dy, FALSE, pixelOutput);
848 draw_cairo_line_to (cairoTarget, x2 + dx, y2 - dy, FALSE, pixelOutput);
849 draw_cairo_line_to (cairoTarget, x1 + dx, y1 - dy, FALSE, pixelOutput);
850 draw_fill (cairoTarget, drawMode, selectionInfo, image, net);
855 draw_cairo_move_to (cairoTarget, x1,y1, oddWidth, pixelOutput);
856 draw_cairo_line_to (cairoTarget, x2,y2, oddWidth, pixelOutput);
857 draw_stroke (cairoTarget, drawMode, selectionInfo, image, net);
869 cairo_new_path(cairoTarget);
871 cairo_set_line_cap (cairoTarget, CAIRO_LINE_CAP_SQUARE);
874 cairo_set_line_cap (cairoTarget, CAIRO_LINE_CAP_ROUND);
876 cairo_save (cairoTarget);
877 cairo_translate(cairoTarget, cp_x, cp_y);
878 cairo_scale (cairoTarget, net->
cirseg->width, net->
cirseg->height);
880 cairo_arc (cairoTarget, 0.0, 0.0, 0.5, net->
cirseg->angle1 * M_PI/180,
881 net->
cirseg->angle2 * M_PI/180);
884 cairo_arc_negative (cairoTarget, 0.0, 0.0, 0.5, net->
cirseg->angle1 * M_PI/180,
885 net->
cirseg->angle2 * M_PI/180);
887 cairo_restore (cairoTarget);
888 draw_stroke (cairoTarget, drawMode, selectionInfo, image, net);
903 cairo_save (cairoTarget);
904 draw_cairo_translate_adjust(cairoTarget, x2, y2, pixelOutput);
908 gerbv_draw_circle(cairoTarget, p0);
909 gerbv_draw_aperature_hole (cairoTarget, p1, p2, pixelOutput);
914 displayPixel = pixelOutput;
915 if (limitLineWidth && (p0 < pixelWidth) && pixelOutput) {
917 displayPixel = FALSE;
919 if (limitLineWidth && (p1 < pixelWidth) && pixelOutput) {
921 displayPixel = FALSE;
923 gerbv_draw_rectangle(cairoTarget, p0, p1, displayPixel);
924 gerbv_draw_aperature_hole (cairoTarget, p2, p3, displayPixel);
927 gerbv_draw_oblong(cairoTarget, p0, p1);
928 gerbv_draw_aperature_hole (cairoTarget, p2, p3, pixelOutput);
931 gerbv_draw_polygon(cairoTarget, p0, p1, p2);
932 gerbv_draw_aperature_hole (cairoTarget, p3, p4, pixelOutput);
935 gerbv_draw_amacro(cairoTarget, drawOperatorClear, drawOperatorDark,
938 drawMode, selectionInfo, image, net);
941 GERB_MESSAGE(_(
"Unknown aperture type"));
945 draw_fill (cairoTarget, drawMode, selectionInfo, image, net);
946 cairo_restore (cairoTarget);
949 GERB_MESSAGE(_(
"Unknown aperture state"));
957 cairo_restore (cairoTarget);
958 cairo_restore (cairoTarget);