X-Git-Url: https://git.donarmstrong.com/?p=xournal.git;a=blobdiff_plain;f=src%2Fxo-shapes.c;h=01f9073d24c9430f5902bfc810e963b78a484e63;hp=0efdf69f0fb404c1e8e8025e1f430c3e83a30928;hb=e648cece76b671b5b0e165acc6d14178e8de1000;hpb=8d8f9e44b17ef9737084eea7693072e4777a0609 diff --git a/src/xo-shapes.c b/src/xo-shapes.c index 0efdf69..01f9073 100644 --- a/src/xo-shapes.c +++ b/src/xo-shapes.c @@ -408,7 +408,7 @@ gboolean try_arrow(void) while (alpha[i]<-M_PI/2) { alpha[i]+=M_PI; rs[i].reversed = !rs[i].reversed; } while (alpha[i]>M_PI/2) { alpha[i]-=M_PI; rs[i].reversed = !rs[i].reversed; } #ifdef RECOGNIZER_DEBUG - printf("arrow: alpha[%d] = %.1f degrees\n", i, alpha[i]*180/M_PI); + printf("DEBUG: arrow: alpha[%d] = %.1f degrees\n", i, alpha[i]*180/M_PI); #endif if (fabs(alpha[i])ARROW_ANGLE_MAX) return FALSE; } @@ -424,20 +424,20 @@ gboolean try_arrow(void) dist = hypot(pt[0]-(rs[j].reversed?rs[j].x1:rs[j].x2), pt[1]-(rs[j].reversed?rs[j].y1:rs[j].y2)); #ifdef RECOGNIZER_DEBUG - printf("linear tolerance: tip[%d] = %.2f\n", j, dist/rs[j].radius); + printf("DEBUG: linear tolerance: tip[%d] = %.2f\n", j, dist/rs[j].radius); #endif if (dist>ARROW_TIP_LINEAR_TOLERANCE*rs[j].radius) return FALSE; } dist = (pt[0]-x2)*sin(angle)-(pt[1]-y2)*cos(angle); dist /= rs[1].radius + rs[2].radius; #ifdef RECOGNIZER_DEBUG - printf("sideways gap tolerance = %.2f\n", dist); + printf("DEBUG: sideways gap tolerance = %.2f\n", dist); #endif if (fabs(dist)>ARROW_SIDEWAYS_GAP_TOLERANCE) return FALSE; dist = (pt[0]-x2)*cos(angle)+(pt[1]-y2)*sin(angle); dist /= rs[1].radius + rs[2].radius; #ifdef RECOGNIZER_DEBUG - printf("main linear gap = %.2f\n", dist); + printf("DEBUG: main linear gap = %.2f\n", dist); #endif if (distARROW_MAIN_LINEAR_GAP_MAX) return FALSE; @@ -534,7 +534,7 @@ void recognize_patterns(void) it = undo->item; calc_inertia(it->path->coords, 0, it->path->num_points-1, &s); #ifdef RECOGNIZER_DEBUG - printf("Mass=%.0f, Center=(%.1f,%.1f), I=(%.0f,%.0f, %.0f), " + printf("DEBUG: Mass=%.0f, Center=(%.1f,%.1f), I=(%.0f,%.0f, %.0f), " "Rad=%.2f, Det=%.4f \n", s.mass, center_x(s), center_y(s), I_xx(s), I_yy(s), I_xy(s), I_rad(s), I_det(s)); #endif @@ -544,9 +544,9 @@ void recognize_patterns(void) if (n>0) { optimize_polygonal(it->path->coords, n, brk, ss); #ifdef RECOGNIZER_DEBUG - printf("Polygon, %d edges: ", n); + printf("DEBUG: Polygon, %d edges: ", n); for (i=0; iCIRCLE_MIN_DET) { score = score_circle(it->path->coords, 0, it->path->num_points-1, &s); #ifdef RECOGNIZER_DEBUG - printf("Circle score: %.2f\n", score); + printf("DEBUG: Circle score: %.2f\n", score); #endif if (score < CIRCLE_MAX_SCORE) { make_circle_shape(center_x(s), center_y(s), I_rad(s));