pcb

Crosshair Rework

Registered by Chad Parker on 2017-11-05

The crosshair is the pair of orthogonal lines used to indicate the coordinates of the next action. It serves a number of purposes related to this primary function, e.g. the position of the crosshair is restricted to grid points, snapping to objects (pins, pads, ends of lines, etc.), and objects can be attached to it for moving or copying.

Presently, the code governing the crosshair is convoluted with many other functions in pcb. This blueprint seeks to coalesce the crosshair code into one location (crosshair.[c,h]), discuss how the crosshair should behave and interact with other elements of pcb, and ultimately revise the crosshair code to be more modular and flexible.

Blueprint information

Status:
Not started
Approver:
None
Priority:
Undefined
Drafter:
Chad Parker
Direction:
Needs approval
Assignee:
None
Definition:
New
Series goal:
None
Implementation:
Unknown
Milestone target:
None

Related branches

Sprints

Whiteboard

Functions served by the crosshair:
* in the GUIs, indicate where the next click should take effect
** snapping is an important part of this. Often this is to grid points, but it can also be to pins or pads, the end points of other traces. Snapping could also be useful in scripts, so, it shouldn't be exclusively a function of the crosshair.
** the limits of the crosshair change when certain things happen in order to ensure consistency. For example, when a part is being moved, the limits of the crosshair are set so that part cannot be placed outside of the workspace (the "board").
* in the batch HID, remember the location of the last action. For example, scripts might execute a relative move of the crosshair in order to execute an action at a location relative to the previous action.
** If pcb had a better scripting language, then this might not need to be the case. Presently, there are no variables, conditionals, etc. in pcb scripting. Since changing this is a major thing, for the moment, the crosshair needs to retain this function.

(?)

Work Items

Work items:
Collect crosshair code into crosshair.[c,h]: TODO

This blueprint contains Public information 
Everyone can see this information.