From 8ffb1d42b607ac6b13b7e642f3772033e93c625f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20H=C3=BCttel?= Date: Thu, 28 Feb 2019 21:17:54 +0100 Subject: [PATCH 1/2] Fix bug of wrong bounding box calculation: Replace DBL_MIN with -DBL_MAX --- trigonometric/bounding-box.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/trigonometric/bounding-box.c b/trigonometric/bounding-box.c index 3499ce4..8f4f8e6 100644 --- a/trigonometric/bounding-box.c +++ b/trigonometric/bounding-box.c @@ -38,7 +38,7 @@ void bounding_box_calculate_polygon(GList *vertices, conv_generic_to_vector_2d_t conv_func, union bounding_box *box) { - double xmin = DBL_MAX, xmax = DBL_MIN, ymin = DBL_MAX, ymax = DBL_MIN; + double xmin = DBL_MAX, xmax = -DBL_MAX, ymin = DBL_MAX, ymax = -DBL_MAX; struct vector_2d temp_vec; GList *list_item; @@ -86,8 +86,8 @@ void bounding_box_prepare_empty(union bounding_box *box) { box->vectors.lower_left.x = DBL_MAX; box->vectors.lower_left.y = DBL_MAX; - box->vectors.upper_right.x = DBL_MIN; - box->vectors.upper_right.y = DBL_MIN; + box->vectors.upper_right.x = -DBL_MAX; + box->vectors.upper_right.y = -DBL_MAX; } static void calculate_path_miter_points(struct vector_2d *a, struct vector_2d *b, struct vector_2d *c, From 586339cac1cf1c766eabec26f72e35099cd2fd84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20H=C3=BCttel?= Date: Tue, 5 Mar 2019 21:46:29 +0100 Subject: [PATCH 2/2] fix doxygen --- doxygen/trigonometric.dox | 6 +++--- external-renderer.h | 3 ++- tree-renderer/tree-store.h | 4 ++-- trigonometric/bounding-box.c | 9 +++++---- trigonometric/cell-trigonometrics.c | 6 +++--- 5 files changed, 15 insertions(+), 13 deletions(-) diff --git a/doxygen/trigonometric.dox b/doxygen/trigonometric.dox index 52819eb..e4a026e 100644 --- a/doxygen/trigonometric.dox +++ b/doxygen/trigonometric.dox @@ -2,7 +2,7 @@ /** * @defgroup trigonometric Trigonometric Helper Functions - * @description The trigonometric helper function will be used in future releases to pcalculate bounding boxes - * @note Currently not in use! - * @warning Code is incomplete. DO NOT USE! + * + * The trigonometric helper function are used to calculate bounding boxes + * @warning Code is incomplete. Please double check forfunctionality! */ diff --git a/external-renderer.h b/external-renderer.h index ecb056b..841b219 100644 --- a/external-renderer.h +++ b/external-renderer.h @@ -36,7 +36,8 @@ /** * @brief function name expected to be found in external library. - * @detail The function has to be defined as follows: + * + * The function has to be defined as follows: * @code * int function_name(gds_cell *toplevel, GList *layer_info_list, char *output_file_name) * @endcode diff --git a/tree-renderer/tree-store.h b/tree-renderer/tree-store.h index aa6d283..85b0f83 100644 --- a/tree-renderer/tree-store.h +++ b/tree-renderer/tree-store.h @@ -37,10 +37,10 @@ enum cell_store_columns { CELL_SEL_LIBRARY = 0, CELL_SEL_CELL, - CELL_SEL_CELL_COLOR, /**< Cell column color */ + CELL_SEL_CELL_COLOR, /**< @brief Cell column color */ CELL_SEL_MODDATE, CELL_SEL_ACCESSDATE, - CELL_SEL_COLUMN_COUNT /**< Not a column. Used to determine count of coumns **/ + CELL_SEL_COLUMN_COUNT /**< @brief Not a column. Used to determine count of columns */ }; struct tree_stores { diff --git a/trigonometric/bounding-box.c b/trigonometric/bounding-box.c index 9d3b26d..c30541d 100644 --- a/trigonometric/bounding-box.c +++ b/trigonometric/bounding-box.c @@ -180,10 +180,11 @@ void bounding_box_update_point(union bounding_box *destination, conv_generic_to_ } /** - * @brief bounding_box_apply_transform - * @param scale scaling factor - * @param rotation roation of bounding box around the origin in degrees (counterclockwise) - * @param box bounding box the operations should be applied to + * @brief Apply transformations onto bounding box. + * @param scale Scaling factor + * @param rotation_deg Roation of bounding box around the origin in degrees (counterclockwise) + * @param flip_at_x Flip the boundig box on the x axis before rotating. + * @param box Bounding box the operations should be applied to. */ void bounding_box_apply_transform(double scale, double rotation_deg, bool flip_at_x, union bounding_box *box) { diff --git a/trigonometric/cell-trigonometrics.c b/trigonometric/cell-trigonometrics.c index 823a531..d6bc4da 100644 --- a/trigonometric/cell-trigonometrics.c +++ b/trigonometric/cell-trigonometrics.c @@ -38,9 +38,9 @@ static void convert_gds_point_to_2d_vector(struct gds_point *pt, struct vector_2 } /** - * @brief update_box_with_gfx - * @param box - * @param gfx_list + * @brief Update the given bounding box with the bounding box of a graphics element. + * @param box box to update + * @param gfx Graphics element */ static void update_box_with_gfx(union bounding_box *box, struct gds_graphics *gfx) {