static double arrow_length_generic(double lenfact, double arrowsize, double penwidth, int flag);
static double arrow_length_normal(double lenfact, double arrowsize, double penwidth, int flag);
+static double arrow_length_box(double lenfact, double arrowsize, double penwidth, int flag);
static const arrowtype_t Arrowtypes[] = {
{ARR_TYPE_NORM, 1.0, arrow_type_normal, arrow_length_normal},
{ARR_TYPE_CROW, 1.0, arrow_type_crow, arrow_length_generic},
{ARR_TYPE_TEE, 0.5, arrow_type_tee, arrow_length_generic},
- {ARR_TYPE_BOX, 1.0, arrow_type_box, arrow_length_generic},
+ {ARR_TYPE_BOX, 1.0, arrow_type_box, arrow_length_box},
{ARR_TYPE_DIAMOND, 1.2, arrow_type_diamond, arrow_length_generic},
{ARR_TYPE_DOT, 0.8, arrow_type_dot, arrow_length_generic},
{ARR_TYPE_CURVE, 1.0, arrow_type_curve, arrow_length_generic},
// the positive x axis and ends at origin
return full_length - overlap;
}
+
+static double arrow_length_box(double lenfact, double arrowsize,
+ double penwidth, int flag) {
+ (void)flag;
+
+ // The `box` arrow shape begins with a polyline which doesn't extend
+ // visually beyond its starting point, so we only have to take penwidth
+ // into account at the end point.
+
+ return lenfact * arrowsize * ARROW_LENGTH + penwidth / 2;
+}