From 2895d664e61a649cac063d23f1fe8a17938d441a Mon Sep 17 00:00:00 2001 From: "Reece R. Pollack" Date: Sat, 4 Jul 2020 13:37:59 -0400 Subject: [PATCH] Add Display Origin Transform data to the PCB_DISPLAY_OPTIONS class This commit adds the user configuration options to support display origin transforms to the PCB_DISPLAY_OPTIONS class. This data is configured by the "Origins & Axes" preferences panel added in a later commit. --- include/pcb_display_options.h | 16 ++++++++++++++++ pcbnew/pcb_display_options.cpp | 4 ++++ 2 files changed, 20 insertions(+) diff --git a/include/pcb_display_options.h b/include/pcb_display_options.h index 7a077d524e..95489f27ad 100644 --- a/include/pcb_display_options.h +++ b/include/pcb_display_options.h @@ -102,6 +102,22 @@ public: double m_PadOpacity; ///< Opacity override for SMD pads and PTHs double m_ZoneOpacity; ///< Opacity override for filled zone areas + /** + * Enum PCB_DISPLAY_ORIGIN_OPTIONS_T + * is the set of values for DISPLAY_OPTIONS.DisplayOrigin parameter option. + * This parameter controls what is used as the origin point for location values + */ + enum PCB_DISPLAY_ORIGIN_OPTIONS_T { + PCB_ORIGIN_PAGE = 0, + PCB_ORIGIN_AUX, + PCB_ORIGIN_GRID, + }; + + /// Which origin is used for display transforms + PCB_DISPLAY_ORIGIN_OPTIONS_T m_DisplayOrigin; + bool m_DisplayInvertXAxis; //< true: Invert the X axis for display + bool m_DisplayInvertYAxis; //< true: Invert the Y axis for display + public: PCB_DISPLAY_OPTIONS(); diff --git a/pcbnew/pcb_display_options.cpp b/pcbnew/pcb_display_options.cpp index 2861ac2510..6007c18c18 100644 --- a/pcbnew/pcb_display_options.cpp +++ b/pcbnew/pcb_display_options.cpp @@ -59,4 +59,8 @@ PCB_DISPLAY_OPTIONS::PCB_DISPLAY_OPTIONS() m_ViaOpacity = 1.0; m_PadOpacity = 1.0; m_ZoneOpacity = 1.0; + + m_DisplayOrigin = PCB_ORIGIN_PAGE; + m_DisplayInvertXAxis = false; + m_DisplayInvertYAxis = false; }