slots bounding box calculation is wrong
Brought to you by:
spetm,
thepurlieu
There was a mistake in this commit: ec09d5c11d7e0aa81a9f7b3fe91054e52454bfa7 . The stop_x,y coordinates are using for the bounding box before the coordinates are adjusted for units. It should be after. Around line 508 in drill.c:
/* Update boundingBox with drilled slot stop_x,y coords */
bbox->left = min(bbox->left, curr_net->stop_x - r);
bbox->right = max(bbox->right, curr_net->stop_x + r);
bbox->bottom = min(bbox->bottom, curr_net->stop_y - r);
bbox->top = max(bbox->top, curr_net->stop_y + r);
drill_update_image_info_min_max_from_bbox(image->info, bbox);
if (state->unit == GERBV_UNIT_MM) {
/* Convert to inches -- internal units */
curr_net->stop_x /= 25.4;
curr_net->stop_y /= 25.4;
}
Added patch here: https://sourceforge.net/p/gerbv/patches/75/
Great! Would you also like to fix memory leaks and the reading of uninitialized memory?
https://sourceforge.net/p/gerbv/bugs/250/
If you fix those then you will have fixed all of the memory leaks and memory errors that valgrind found when running pcb2gcode.
Ah, wait, there is another:
That's the last one I think. I can run valgrind on gerbv again when it's merged.