Skip to content

Display Origin Transform request for comments

Sorry for the premature comment request yesterday; I found an issue that required a bit of a structural change so there was no point in anyone commenting on that version.

This is a rewrite (not a port) of last year's Display Origin Transforms feature for Pcbnew. As a work-in-progress it is not intended for merge to "master" as it is functionally incomplete.

The goal is to allow the user to select which point represents the (0,0) coordinate origin for all user coordinate display and entry. The user can select between:

  • The upper-left corner of the page (current behavior and default)
  • The Drill & Place (aux) origin
  • The Grid origin

It also permits the user to select the direction in which the axes increase:

  • X axis: right (current and default) or left
  • Y axis: down (current and default) or up

This feature does not change the internal representation of the board in any way. These are display options only. The defaults are set so a user running Pcbnew with this feature for the first time will see no changes at all.

I've pushed the first phase of changes, which implement the Pcbnew status line and the dialogs that use the UNIT_BINDER class. It all compiles cleanly under Linux. The parts I've tested work fine but I have to remember how to get to some of the dialogs. The code needs some formatting clean-up, and the internal documentation will get improved.

There is a new panel under Preferences -> Preferences -> Origins & Axes. This settings panel allows easy configuration. The user's selections are stored in the "pcb_display" section of the pcbnew.json file. My usual configuration (Aux origin, X increases right, Y increases up) results in these lines in the user preferences:

    "origin_invert_x_axis": false,
    "origin_invert_y_axis": true,
    "origin_mode": 1,

Still missing is support for GetMsgPanelInfo (except for the DRAWSEGMENT class), GetSelectMenuText, and DRC markers. These still display referenced to the the page origin, and thus will make sense only if the display origin is the same. Fixing this will require some additional study as there have been significant code changes since I last looked at it.

It'd be nice to get some eyes and maybe some run time on this. Constructive comments and bug reports are welcome, of course!

Edited by Seth Hillbrand

Merge request reports