Index: src/action.c =================================================================== --- src/action.c (revision 948) +++ src/action.c (revision 949) @@ -197,6 +197,8 @@ F_ToggleRubberBandMode, F_ToggleStartDirection, F_ToggleSnapPin, + F_ToggleSnapOffGridLine, + F_ToggleHighlightOnPoint, F_ToggleThindraw, F_ToggleLockNames, F_ToggleOnlyNames, @@ -427,6 +429,8 @@ {"ToggleRubberBandMode", F_ToggleRubberBandMode}, {"ToggleStartDirection", F_ToggleStartDirection}, {"ToggleSnapPin", F_ToggleSnapPin}, + {"ToggleSnapOffGridLine", F_ToggleSnapOffGridLine}, + {"ToggleHighlightOnPoint", F_ToggleHighlightOnPoint}, {"ToggleThindraw", F_ToggleThindraw}, {"ToggleThindrawPoly", F_ToggleThindrawPoly}, {"ToggleLockNames", F_ToggleLockNames}, @@ -2516,7 +2520,8 @@ "Display(Grid|Redraw)\n" "Display(CycleClip|CycleCrosshair|Toggle45Degree|ToggleStartDirection)\n" "Display(ToggleGrid|ToggleRubberBandMode|ToggleUniqueNames)\n" - "Display(ToggleMask|ToggleName|ToggleClearLine|ToggleFullPoly|ToggleSnapPin)\n" + "Display(ToggleMask|ToggleName|ToggleClearLine|ToggleFullPoly)\n" + "Display(ToggleSnapPin|ToggleSnapOffGridLine|ToggleHighlightOnPoint)\n" "Display(ToggleThindraw|ToggleThindrawPoly|ToggleOrthoMove|ToggleLocalRef)\n" "Display(ToggleCheckPlanes|ToggleShowDRC|ToggleAutoDRC)\n" "Display(ToggleLiveRoute|LockNames|OnlyNames)\n" @@ -2565,6 +2570,13 @@ If set, pin centers and pad end points are treated as additional grid points that the cursor can snap to. +@item ToggleSnapOffGridLine +If set, snap at some sensible point along a line. + +@item ToggleHighlightOnPoint +If set, highlights lines and arcs when the crosshair is on one of their +two (end) points. + @item ToggleLocalRef If set, the mark is automatically set to the beginning of any move, so you can see the relative distance you've moved. @@ -2767,6 +2779,18 @@ notify_crosshair_change (true); break; + case F_ToggleSnapOffGridLine: + notify_crosshair_change (false); + TOGGLE_FLAG (SNAPOFFGRIDLINEFLAG, PCB); + notify_crosshair_change (true); + break; + + case F_ToggleHighlightOnPoint: + notify_crosshair_change (false); + TOGGLE_FLAG (HIGHLIGHTONPOINTFLAG, PCB); + notify_crosshair_change (true); + break; + case F_ToggleLocalRef: TOGGLE_FLAG (LOCALREFFLAG, PCB); break; Index: src/const.h =================================================================== --- src/const.h (revision 948) +++ src/const.h (revision 949) @@ -217,7 +217,10 @@ #define VISITFLAG 0x8000 /* marker to avoid re-visiting an object */ #define NONETLISTFLAG 0x10000 /* element is not on the netlist and should not interfere with the netlist */ #define MINCUTFLAG 0x20000 /* used by the mincut short find code */ +#define ONPOINTFLAG 0x40000 /*!< crosshair is on line point or arc point */ +#define NOCOPY_FLAGS (FOUNDFLAG | CONNECTEDFLAG | ONPOINTFLAG) + /* --------------------------------------------------------------------------- * PCB flags */ @@ -273,10 +276,14 @@ New polygons are full polygons. @item 0x200000 When set, element names are not drawn. ++@item 0x800000 ++snap to certain off-grid points. ++@item 0x1000000 ++highlight lines and arcs when the crosshair is on one of their endpoints. @end table %end-doc */ -#define PCB_FLAGS 0x000fffff /* all used flags */ +#define PCB_FLAGS 0x01ffffff /* all used flags */ #define SHOWNUMBERFLAG 0x00000001 #define LOCALREFFLAG 0x00000002 @@ -301,6 +308,8 @@ #define NEWFULLPOLYFLAG 0x00100000 #define HIDENAMESFLAG 0x00200000 #define ENABLEMINCUTFLAG 0x00400000 +#define SNAPOFFGRIDLINEFLAG 0x00800000 +#define HIGHLIGHTONPOINTFLAG 0x01000000 /* --------------------------------------------------------------------------- * object types Index: src/create.c =================================================================== --- src/create.c (revision 948) +++ src/create.c (revision 949) @@ -170,6 +170,10 @@ SET_FLAG (UNIQUENAMEFLAG, ptr); if (Settings.SnapPin) SET_FLAG (SNAPPINFLAG, ptr); + if (Settings.SnapOffGridLine) + SET_FLAG (SNAPOFFGRIDLINEFLAG, ptr); + if (Settings.HighlightOnPoint) + SET_FLAG (HIGHLIGHTONPOINTFLAG, ptr); if (Settings.ClearLine) SET_FLAG (CLEARNEWFLAG, ptr); if (Settings.FullPoly) Index: src/crosshair.c =================================================================== --- src/crosshair.c (revision 948) +++ src/crosshair.c (revision 949) @@ -35,9 +35,11 @@ #include #include +#include #include "global.h" +#include "box.h" #include "crosshair.h" #include "data.h" #include "draw.h" @@ -45,6 +47,7 @@ #include "line.h" #include "misc.h" #include "mymem.h" +#include "rtree.h" #include "search.h" #include "polygon.h" @@ -782,6 +785,171 @@ notify_mark_change (true); } +/* + * Below is the implementation of the "highlight on endpoint" functionality. + * This highlights lines and arcs when the crosshair is on of their (two) + * endpoints. + */ +struct onpoint_search_info { + CrosshairType *crosshair; + Coord X; + Coord Y; +}; + +static int +onpoint_line_callback(const BoxType *box, void *cl) +{ + struct onpoint_search_info *info = (struct onpoint_search_info *)cl; + CrosshairType *crosshair = info->crosshair; + LineType *line = (LineType *)box; + +#ifdef DEBUG_ONPOINT + printf("X=%ld Y=%ld X1=%ld Y1=%ld X2=%ld Y2=%ld\n", info->X, info->Y, + line->Point1.X, + line->Point1.Y, + line->Point2.X, + line->Point2.Y); +#endif + if ((line->Point1.X == info->X && line->Point1.Y == info->Y) || + (line->Point2.X == info->X && line->Point2.Y == info->Y)) + { + crosshair->onpoint_objs = + g_list_prepend(crosshair->onpoint_objs, line); + crosshair->onpoint_objs_types = + g_list_prepend(crosshair->onpoint_objs_types, + GINT_TO_POINTER(LINE_TYPE)); + SET_FLAG(ONPOINTFLAG, (AnyObjectType *)line); + DrawLine(NULL, line); + return 1; + } + else + { + return 0; + } +} + +static int +onpoint_arc_callback(const BoxType *box, void *cl) +{ + struct onpoint_search_info *info = (struct onpoint_search_info *)cl; + CrosshairType *crosshair = info->crosshair; + ArcType *arc = (ArcType *)box; + Coord p1x, p1y, p2x, p2y; + + p1x = arc->X - arc->Width * cos (TO_RADIANS (arc->StartAngle)); + p1y = arc->Y + arc->Height * sin (TO_RADIANS (arc->StartAngle)); + p2x = arc->X - arc->Width * cos (TO_RADIANS (arc->StartAngle + arc->Delta)); + p2y = arc->Y + arc->Height * sin (TO_RADIANS (arc->StartAngle + arc->Delta)); + + + if ((p1x == info->X && p1y == info->Y) || + (p2x == info->X && p2y == info->Y)) + { + crosshair->onpoint_objs = + g_list_prepend(crosshair->onpoint_objs, arc); + crosshair->onpoint_objs_types = + g_list_prepend(crosshair->onpoint_objs_types, GINT_TO_POINTER(ARC_TYPE)); + SET_FLAG(ONPOINTFLAG, (AnyObjectType *)arc); + DrawArc(NULL, arc); + return 1; + } + else + { + return 0; + } +} + +void DrawLineOrArc(int type, void *obj) +{ + switch (type) + { + case LINEPOINT_TYPE: + /* Attention: We can use a NULL pointer here for the layer, + * because it is not used in the DrawLine() function anyways. + * ATM DrawLine() only alls AddPart() internally, which invalidates + * the area specified by the line's bounding box. + */ + DrawLine(NULL, (LineType *)obj); + break; +#if 0 + case ARCPOINT_TYPE: + /* See comment above */ + DrawArc(NULL, (ArcType *)obj); + break; +#endif + } +} + +/* + * Searches for lines or arcs which have points that are exactly + * at the given coordinates and adds them to the crosshair's + * object list along with their respective type. + */ +static void onpoint_work(CrosshairType *crosshair, Coord X, Coord Y) +{ + BoxType SearchBox = point_box(X, Y); + struct onpoint_search_info info; + int i; + GList *lobjs, *ltypes; + GList *old_onpoint_objs = crosshair->onpoint_objs; + GList *old_onpoint_objs_types = crosshair->onpoint_objs_types; + bool redraw = false; + + crosshair->onpoint_objs = NULL; + crosshair->onpoint_objs_types = NULL; + + info.crosshair = crosshair; + info.X = X; + info.Y = Y; + + for (i = 0; i < max_copper_layer; i++) + { + LayerType *layer = &PCB->Data->Layer[i]; + /* Only find points of arcs and lines on currently visible layers. */ + if (!layer->On) + continue; + r_search(layer->line_tree, &SearchBox, NULL, + onpoint_line_callback, &info); + r_search(layer->arc_tree, &SearchBox, NULL, + onpoint_arc_callback, &info); + } + + /* Undraw the old objects */ + for (lobjs = old_onpoint_objs, ltypes = old_onpoint_objs_types; + lobjs != NULL; + lobjs = lobjs->next, ltypes = ltypes->next) + { + /* only remove and redraw those which aren't in the new list */ + if (g_list_find(crosshair->onpoint_objs, lobjs->data) != NULL) + continue; + + CLEAR_FLAG(ONPOINTFLAG, (AnyObjectType *)lobjs->data); + DrawLineOrArc(GPOINTER_TO_INT(ltypes->data), lobjs->data); + redraw = true; + } + + /* draw the new objects */ + for (lobjs = crosshair->onpoint_objs, + ltypes = crosshair->onpoint_objs_types; + lobjs != NULL; + lobjs = lobjs->next, ltypes = ltypes->next) + { + /* only draw those which aren't in the old list */ + if (g_list_find(old_onpoint_objs, lobjs->data) != NULL) + continue; + DrawLineOrArc(GPOINTER_TO_INT(ltypes->data), lobjs->data); + redraw = true; + } + + g_list_free(old_onpoint_objs); + g_list_free(old_onpoint_objs_types); + + if (redraw) + { + Redraw(); + } +} + /* --------------------------------------------------------------------------- * Returns the square of the given number */ @@ -1075,7 +1243,11 @@ check_snap_object (&snap_data, pnt->X, pnt->Y, true); } - check_snap_offgrid_line (&snap_data, nearest_grid_x, nearest_grid_y); + /* + * Snap to offgrid points on lines. + */ + if (TEST_FLAG (SNAPOFFGRIDLINEFLAG, PCB)) + check_snap_offgrid_line (&snap_data, nearest_grid_x, nearest_grid_y); ans = NO_TYPE; if (TEST_FLAG (SNAPPINFLAG, PCB)) @@ -1094,6 +1266,9 @@ Crosshair.Y = snap_data.y; } + if (TEST_FLAG (HIGHLIGHTONPOINTFLAG, PCB)) + onpoint_work(&Crosshair, Crosshair.X, Crosshair.Y); + if (Settings.Mode == ARROW_MODE) { ans = SearchScreenGridSlop (Crosshair.X, Crosshair.Y, @@ -1187,6 +1362,10 @@ Crosshair.MaxX = PCB->MaxWidth; Crosshair.MaxY = PCB->MaxHeight; + /* Initialize the onpoint data. */ + Crosshair.onpoint_objs = NULL; + Crosshair.onpoint_objs_types = NULL; + /* clear the mark */ Marked.status = false; } Index: src/draw.c =================================================================== --- src/draw.c (revision 948) +++ src/draw.c (revision 949) @@ -90,6 +90,28 @@ static void DrawRats (const BoxType *); static void DrawSilk (int side, const BoxType *); +static void +LightenColor(const char *orig, char buf[8], double factor) +{ + unsigned int r, g, b; + + if (orig[0] == '#') + { + sscanf(&orig[1], "%2x%2x%2x", &r, &g, &b); + r = MIN(255, r * factor); + g = MIN(255, g * factor); + b = MIN(255, b * factor); + } + else + { + r = 0xff; + g = 0xff; + b = 0xff; + } + snprintf(buf, sizeof("#XXXXXX"), "#%02x%02x%02x", r, g, b); +} + + /*-------------------------------------------------------------------------------------- * setup color for pin or via */ @@ -97,6 +119,7 @@ SetPVColor (PinTypePtr Pin, int Type) { char *color; + char buf[sizeof("#XXXXXX")]; if (Type == VIA_TYPE) { @@ -109,6 +132,13 @@ color = PCB->ViaSelectedColor; else color = PCB->ConnectedColor; + + if (TEST_FLAG(ONPOINTFLAG, Pin)) + { + assert(color != NULL); + LightenColor(color, buf, 1.75); + color = buf; + } } else color = PCB->ViaColor; @@ -124,6 +154,13 @@ color = PCB->PinSelectedColor; else color = PCB->ConnectedColor; + + if (TEST_FLAG(ONPOINTFLAG, Pin)) + { + assert(color != NULL); + LightenColor(color, buf, 1.75); + color = buf; + } } else color = PCB->PinColor; @@ -324,22 +361,34 @@ static void draw_pad (PadType *pad) { + const char *color; + char buf[sizeof("#XXXXXX")]; + if (doing_pinout) gui->set_color (Output.fgGC, PCB->PinColor); else if (TEST_FLAG (WARNFLAG | SELECTEDFLAG | FOUNDFLAG, pad)) { if (TEST_FLAG (WARNFLAG, pad)) - gui->set_color (Output.fgGC, PCB->WarnColor); + color = PCB->WarnColor; else if (TEST_FLAG (SELECTEDFLAG, pad)) - gui->set_color (Output.fgGC, PCB->PinSelectedColor); + color = PCB->PinSelectedColor; else - gui->set_color (Output.fgGC, PCB->ConnectedColor); + color = PCB->ConnectedColor; + } else if (FRONT (pad)) - gui->set_color (Output.fgGC, PCB->PinColor); + color = PCB->PinColor; else - gui->set_color (Output.fgGC, PCB->InvisibleObjectsColor); + color = PCB->InvisibleObjectsColor; + if (TEST_FLAG(ONPOINTFLAG, pad)) + { + assert(color != NULL); + LightenColor(color, buf, 1.75); + color = buf; + } + gui->set_color (Output.fgGC, color); + _draw_pad (Output.fgGC, pad, false, false); if (doing_pinout || TEST_FLAG (DISPLAYNAMEFLAG, pad)) @@ -426,6 +475,8 @@ { PinTypePtr pv = (PinTypePtr) b; int plated = cl ? *(int *) cl : -1; + const char *color; + char buf[sizeof("#XXXXXX")]; if ((plated == 0 && !TEST_FLAG (HOLEFLAG, pv)) || (plated == 1 && TEST_FLAG (HOLEFLAG, pv))) @@ -448,12 +499,20 @@ if (TEST_FLAG (HOLEFLAG, pv)) { if (TEST_FLAG (WARNFLAG, pv)) - gui->set_color (Output.fgGC, PCB->WarnColor); + color = PCB->WarnColor; else if (TEST_FLAG (SELECTEDFLAG, pv)) - gui->set_color (Output.fgGC, PCB->ViaSelectedColor); + color = PCB->ViaSelectedColor; else - gui->set_color (Output.fgGC, Settings.BlackColor); + color = Settings.BlackColor; + if (TEST_FLAG(ONPOINTFLAG, pv)) + { + assert(color != NULL); + LightenColor(color, buf, 1.75); + color = buf; + } + gui->set_color (Output.fgGC, color); + gui->set_line_cap (Output.fgGC, Round_Cap); gui->set_line_width (Output.fgGC, 0); gui->draw_arc (Output.fgGC, @@ -492,17 +551,29 @@ static void draw_line (LayerType *layer, LineType *line) { + const char *color; + char buf[sizeof("#XXXXXX")]; + if (TEST_FLAG (WARNFLAG, line)) - gui->set_color(Output.fgGC, PCB->WarnColor); + color = PCB->WarnColor; else if (TEST_FLAG (SELECTEDFLAG | FOUNDFLAG, line)) { if (TEST_FLAG (SELECTEDFLAG, line)) - gui->set_color (Output.fgGC, layer->SelectedColor); + color = layer->SelectedColor; else - gui->set_color (Output.fgGC, PCB->ConnectedColor); + color = PCB->ConnectedColor; } else - gui->set_color (Output.fgGC, layer->Color); + color = layer->Color; + + if (TEST_FLAG(ONPOINTFLAG, line)) + { + assert(color != NULL); + LightenColor(color, buf, 1.75); + color = buf; + } + + gui->set_color(Output.fgGC, color); _draw_line (line); } @@ -566,18 +637,28 @@ static void draw_arc (LayerType *layer, ArcType *arc) { + const char *color; + char buf[sizeof("#XXXXXX")]; + if (TEST_FLAG (WARNFLAG, arc)) - gui->set_color(Output.fgGC, PCB->WarnColor); + color = PCB->WarnColor; else if (TEST_FLAG (SELECTEDFLAG | FOUNDFLAG, arc)) { if (TEST_FLAG (SELECTEDFLAG, arc)) - gui->set_color (Output.fgGC, layer->SelectedColor); + color = layer->SelectedColor; else - gui->set_color (Output.fgGC, PCB->ConnectedColor); + color = PCB->ConnectedColor; } else - gui->set_color (Output.fgGC, layer->Color); + color = layer->Color; + if (TEST_FLAG(ONPOINTFLAG, arc)) + { + assert(color != NULL); + LightenColor(color, buf, 1.75); + color = buf; + } + gui->set_color (Output.fgGC, color); _draw_arc (arc); } @@ -906,6 +987,7 @@ struct poly_info *i = cl; PolygonType *polygon = (PolygonType *)b; static char *color; + char buf[sizeof("#XXXXXX")]; if (!polygon->Clipped) return 0; @@ -916,6 +998,12 @@ color = i->layer->SelectedColor; else if (TEST_FLAG (FOUNDFLAG, polygon)) color = PCB->ConnectedColor; + else if (TEST_FLAG(ONPOINTFLAG, polygon)) + { + assert(color != NULL); + LightenColor(color, buf, 1.75); + color = buf; + } else color = i->layer->Color; gui->set_color (Output.fgGC, color); Index: src/flags.c =================================================================== --- src/flags.c (revision 948) +++ src/flags.c (revision 949) @@ -246,6 +246,8 @@ {"newfullpoly", FlagTESTFLAG, NEWFULLPOLYFLAG}, {"hidenames", FlagTESTFLAG, HIDENAMESFLAG}, {"enablemincut", FlagTESTFLAG, ENABLEMINCUTFLAG}, + {"snapoffgridline", FlagTESTFLAG, GINT_TO_POINTER (SNAPOFFGRIDLINEFLAG)}, + {"highlightonpoint", FlagTESTFLAG, GINT_TO_POINTER (HIGHLIGHTONPOINTFLAG)}, {"fullpoly", FlagSETTINGS, OffsetOf (SettingType, FullPoly)}, {"grid_units_mm", FlagUnitsMm, -1}, Index: src/global.h =================================================================== --- src/global.h (revision 948) +++ src/global.h (revision 949) @@ -616,6 +616,8 @@ PolygonType AttachedPolygon; AttachedObjectType AttachedObject; /* data of attached objects */ enum crosshair_shape shape; /* shape of crosshair */ + GList *onpoint_objs; /* list of associated lines/arc */ + GList *onpoint_objs_types; /* ..and a list of their respective types */ } CrosshairType, *CrosshairTypePtr; typedef struct @@ -694,6 +696,8 @@ bool ClearLine, FullPoly, UniqueNames, /* force unique names */ SnapPin, /* snap to pins and pads */ + SnapOffGridLine, /*!< Snap to certain off-grid points along a line. */ + HighlightOnPoint, /*!< Highlight if crosshair is on endpoints. */ ShowSolderSide, /* mirror output */ SaveLastCommand, /* save the last command entered by user */ SaveInTMP, /* always save data in /tmp */ Index: src/gpcb-menu.res =================================================================== --- src/gpcb-menu.res (revision 948) +++ src/gpcb-menu.res (revision 949) @@ -202,6 +202,7 @@ {"Auto swap line start angle" checked=swapstartdir Display(ToggleStartDirection)} {"Orthogonal moves" checked=orthomove Display(ToggleOrthoMove)} {"Crosshair snaps to pins and pads" checked=snappin Display(ToggleSnapPin)} + {"Crosshair snaps to off-grid points on lines" checked=snapoffgridline Display(ToggleSnapOffGridLine)} {"Crosshair shows DRC clearance" checked=showdrc Display(ToggleShowDRC)} {"Auto enforce DRC clearance" checked=autodrc Display(ToggleAutoDRC)} {"Lock Names" checked=locknames Display(ToggleLockNames)} @@ -215,6 +216,7 @@ {"New lines, arcs clear polygons" checked=clearnew Display(ToggleClearLine)} {"New polygons are full ones" checked=newfullpoly Display(ToggleFullPoly)} {"Show autorouter trials" checked=liveroute Display(ToggleLiveRoute)} + {"Highlighting on line, arc points" checked=highlightonpoint Display(ToggleHighlightOnPoint)} {"Thin draw" checked=thindraw Display(ToggleThindraw) a={"|" "|"}} {"Thin draw poly" checked=thindrawpoly Display(ToggleThindrawPoly) a={"Ctrl-Shift-P" "Ctrl Shiftp"}} {"Check polygons" checked=checkplanes Display(ToggleCheckPlanes)} Index: src/hid/gtk/gtkhid-gdk.c =================================================================== --- src/hid/gtk/gtkhid-gdk.c (revision 948) +++ src/hid/gtk/gtkhid-gdk.c (revision 949) @@ -116,6 +116,8 @@ { if (gc->gc) g_object_unref (gc->gc); + if (gc->colorname != NULL) + g_free(gc->colorname); g_free (gc); } @@ -126,7 +128,7 @@ rv = g_new0 (hid_gc_struct, 1); rv->me_pointer = &ghid_hid; - rv->colorname = Settings.BackgroundColor; + rv->colorname = g_strdup(Settings.BackgroundColor); return rv; } @@ -381,7 +383,13 @@ name = "magenta"; } - gc->colorname = (char *) name; + if (name != gc->colorname) + { + if (gc->colorname != NULL) + g_free(gc->colorname); + gc->colorname = g_strdup(name); + } + if (!gc->gc) return; if (gport->colormap == 0) Index: src/hid/lesstif/main.c =================================================================== --- src/hid/lesstif/main.c (revision 948) +++ src/hid/lesstif/main.c (revision 949) @@ -53,7 +53,7 @@ { HID *me_pointer; Pixel color; - const char *colorname; + char *colorname; int width; EndCapStyle cap; char xor_set; @@ -3063,6 +3063,7 @@ hidGC rv = (hid_gc_struct *) malloc (sizeof (hid_gc_struct)); memset (rv, 0, sizeof (hid_gc_struct)); rv->me_pointer = &lesstif_hid; + rv->colorname = NULL; return rv; } @@ -3069,6 +3070,8 @@ static void lesstif_destroy_gc (hidGC gc) { + if (gc->colorname != NULL) + g_free(gc->colorname); free (gc); } @@ -3137,7 +3140,14 @@ return; if (!name) name = "red"; - gc->colorname = name; + + if (name != gc->colorname) + { + if (gc->colorname != NULL) + g_free(gc->colorname); + gc->colorname = g_strdup(name); + } + if (strcmp (name, "erase") == 0) { gc->color = bgcolor; Index: src/main.c =================================================================== --- src/main.c (revision 948) +++ src/main.c (revision 949) @@ -1247,6 +1247,27 @@ BSET (SnapPin, 1, "snap-pin", "If set, the cursor snaps to pads and pin centers"), +/* %start-doc options "2 General GUI Options" +@ftable @code +@item --snap-offgrid-line +If set, the cursor snaps at sensible points along a line +@end ftable +%end-doc +*/ + BSET (SnapOffGridLine, 1, "snap-offgrid-line", + "If set, the cursor snaps at sensible points along a line"), + +/* %start-doc options "2 General GUI Options" +@ftable @code +@item --highlight-on-point +If set, highlights lines and arcs when the crosshair is on one of their +two (end) points. +@end ftable +%end-doc +*/ + BSET (HighlightOnPoint, 0, "highlight-on-point", + "If set, highlights lines and arcs when the cursor is on their endpoints"), + /* %start-doc options "1 General Options" @ftable @code @item --save-last-command Index: src/pcb-menu.res =================================================================== --- src/pcb-menu.res (revision 948) +++ src/pcb-menu.res (revision 949) @@ -193,6 +193,7 @@ {"Auto swap line start angle" checked=swapstartdir Display(ToggleStartDirection)} {"Orthogonal moves" checked=orthomove Display(ToggleOrthoMove)} {"Crosshair snaps to pins and pads" checked=snappin Display(ToggleSnapPin)} + {"Crosshair snaps to off-grid points on lines" checked=snapoffgridline Display(ToggleSnapOffGridLine)} {"Crosshair shows DRC clearance" checked=showdrc Display(ToggleShowDRC)} {"Auto enforce DRC clearance" checked=autodrc Display(ToggleAutoDRC)} - @@ -202,6 +203,7 @@ {"New lines, arcs clear polygons" checked=clearnew Display(ToggleClearLine)} {"New polygons are full ones" checked=newfullpoly Display(ToggleFullPoly)} {"Show autorouter trials" checked=liveroute Display(ToggleLiveRoute)} + {"Highlighting on line, arc points" checked=highlightonpoint Display(ToggleHighlightOnPoint)} {"Thin draw" checked=thindraw Display(ToggleThindraw) a={"|" "|"}} {"Thin draw poly" checked=thindrawpoly Display(ToggleThindrawPoly) a={"Ctrl-Shift-P" "Ctrl Shiftp"}} {"Check polygons" checked=checkplanes Display(ToggleCheckPlanes)} Index: src/strflags.c =================================================================== --- src/strflags.c (revision 948) +++ src/strflags.c (revision 949) @@ -95,6 +95,8 @@ { PININPOLYFLAG, N ("pininpoly"), PIN_TYPES | PAD_TYPE }, { CLEARPOLYFLAG, N ("clearpoly"), POLYGON_TYPE }, { HIDENAMEFLAG, N ("hidename"), ELEMENT_TYPE }, + { SNAPOFFGRIDLINEFLAG, N ("snapoffgridline"), ALL_TYPES }, + { HIGHLIGHTONPOINTFLAG, N ("highlightonpoint"), ALL_TYPES }, { DISPLAYNAMEFLAG, N ("showname"), ELEMENT_TYPE }, { CLEARLINEFLAG, N ("clearline"), LINE_TYPE | ARC_TYPE | TEXT_TYPE }, { SELECTEDFLAG, N ("selected"), ALL_TYPES },