Skip to content

Commit

Permalink
chore/style: add brackets
Browse files Browse the repository at this point in the history
  • Loading branch information
drahnr committed Nov 27, 2019
1 parent c4dc5f5 commit 9be22fe
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
8 changes: 5 additions & 3 deletions src/sheet/create-wire.c
Original file line number Diff line number Diff line change
Expand Up @@ -310,8 +310,9 @@ inline static gboolean create_wire_fixate (Sheet *sheet, GdkEvent *event)
// if we are back at the starting point of our wire,
// and the user tries to fixate, just ignore it
// and mark the event as handled
if (coords_equal (&p1, &p2))
if (coords_equal (&p1, &p2)) {
return TRUE;
}

schematic = schematic_view_get_schematic_from_sheet (sheet);
g_assert (schematic);
Expand Down Expand Up @@ -386,10 +387,11 @@ inline static gboolean create_wire_fixate (Sheet *sheet, GdkEvent *event)
g_object_set (G_OBJECT (create_wire_info->line), "points", create_wire_info->points, NULL);

// toggle wire direction
if (create_wire_info->direction == WIRE_DIR_VERT)
if (create_wire_info->direction == WIRE_DIR_VERT) {
create_wire_info->direction = WIRE_DIR_HORIZ;
else
} else {
create_wire_info->direction = WIRE_DIR_VERT;
}

goo_canvas_item_raise (GOO_CANVAS_ITEM (create_wire_info->line), NULL);

Expand Down
9 changes: 6 additions & 3 deletions src/sheet/sheet.c
Original file line number Diff line number Diff line change
Expand Up @@ -247,8 +247,9 @@ gboolean sheet_get_pointer_pixel (Sheet *sheet, gdouble *x, gdouble *y)
x1 = (gdouble)_x;
y1 = (gdouble)_y;

if (!sheet_get_adjustments (sheet, &hadj, &vadj))
if (!sheet_get_adjustments (sheet, &hadj, &vadj)) {
return FALSE;
}

x1 += gtk_adjustment_get_value (hadj);
y1 += gtk_adjustment_get_value (vadj);
Expand All @@ -267,16 +268,18 @@ gboolean sheet_get_pointer_pixel (Sheet *sheet, gdouble *x, gdouble *y)
*/
gboolean sheet_get_pointer (Sheet *sheet, gdouble *x, gdouble *y)
{
if (!sheet_get_pointer_pixel (sheet, x, y))
if (!sheet_get_pointer_pixel (sheet, x, y)) {
return FALSE;
}
goo_canvas_convert_from_pixels (GOO_CANVAS (sheet), x, y);
return TRUE;
}

gboolean sheet_get_pointer_snapped (Sheet *sheet, gdouble *x, gdouble *y)
{
if (!sheet_get_pointer_pixel (sheet, x, y))
if (!sheet_get_pointer_pixel (sheet, x, y)) {
return FALSE;
}
goo_canvas_convert_from_pixels (GOO_CANVAS (sheet), x, y);
snap_to_grid (sheet->grid, x, y);
return TRUE;
Expand Down

0 comments on commit 9be22fe

Please sign in to comment.