diff options
-rw-r--r-- | NEWS | 4 | ||||
-rw-r--r-- | src/port.c | 18 |
2 files changed, 12 insertions, 10 deletions
@@ -4,12 +4,12 @@ ganv (1.5.0) unstable; * Fix unexpected node jumping when dragging new connections. * Add support for PDF and PS export. * Improve text rendering at high zoom. - * Line up ports precisely at module border edges. + * Fix various minor visual alignment/sizing issues. * Fix size of vertical flow modules. * Fix compilation with --no-fdgl (patch from Vlad Glagolev). * Fix crash when destroying canvas. - -- David Robillard <d@drobilla.net> Tue, 10 Feb 2015 23:50:27 -0500 + -- David Robillard <d@drobilla.net> Tue, 10 Feb 2015 23:58:57 -0500 ganv (1.4.2) stable; @@ -170,19 +170,20 @@ ganv_port_tail_vector(const GanvNode* self, GanvItem* item = &port->box.node.item; GanvCanvas* canvas = ganv_item_get_canvas(item); - const double px = item->impl->x; - const double py = item->impl->y; + const double px = item->impl->x; + const double py = item->impl->y; + const double border_width = GANV_NODE(port)->impl->border_width; switch (ganv_canvas_get_direction(canvas)) { case GANV_DIRECTION_RIGHT: - *x = px + ganv_box_get_width(&port->box); + *x = px + ganv_box_get_width(&port->box) + (border_width / 2.0); *y = py + ganv_box_get_height(&port->box) / 2.0; *dx = 1.0; *dy = 0.0; break; case GANV_DIRECTION_DOWN: *x = px + ganv_box_get_width(&port->box) / 2.0; - *y = py + ganv_box_get_height(&port->box); + *y = py + ganv_box_get_height(&port->box) + (border_width / 2.0); *dx = 0.0; *dy = 1.0; break; @@ -203,19 +204,20 @@ ganv_port_head_vector(const GanvNode* self, GanvItem* item = &port->box.node.item; GanvCanvas* canvas = ganv_item_get_canvas(item); - const double px = item->impl->x; - const double py = item->impl->y; + const double px = item->impl->x; + const double py = item->impl->y; + const double border_width = GANV_NODE(port)->impl->border_width; switch (ganv_canvas_get_direction(canvas)) { case GANV_DIRECTION_RIGHT: - *x = px; + *x = px - (border_width / 2.0); *y = py + ganv_box_get_height(&port->box) / 2.0; *dx = -1.0; *dy = 0.0; break; case GANV_DIRECTION_DOWN: *x = px + ganv_box_get_width(&port->box) / 2.0; - *y = 0.0; + *y = py - (border_width / 2.0); *dx = 0.0; *dy = -1.0; break; |