From 6eb5733a0bc0794f40ff4b1fa23c0d549157ef97 Mon Sep 17 00:00:00 2001 From: Jon Evans Date: Thu, 11 Jan 2018 22:32:14 -0500 Subject: [PATCH] LSET::UIOrder and LSET::Technicals now match layer widget order Fixes: lp:1673792 * https://bugs.launchpad.net/kicad/+bug/1673792 --- common/lset.cpp | 52 ++++++++++++++++------- include/layers_id_colors_and_visibility.h | 3 ++ 2 files changed, 40 insertions(+), 15 deletions(-) diff --git a/common/lset.cpp b/common/lset.cpp index 8008b0ac42..9ef9de2f51 100644 --- a/common/lset.cpp +++ b/common/lset.cpp @@ -190,18 +190,18 @@ LSEQ LSET::Technicals( LSET aSetToOmit ) const { // desired sequence static const PCB_LAYER_ID sequence[] = { - B_Adhes, F_Adhes, - B_Paste, + B_Adhes, F_Paste, - B_SilkS, + B_Paste, F_SilkS, - B_Mask, + B_SilkS, F_Mask, - B_CrtYd, + B_Mask, F_CrtYd, - B_Fab, + B_CrtYd, F_Fab, + B_Fab, }; LSET subset = ~aSetToOmit & *this; @@ -226,6 +226,33 @@ LSEQ LSET::Users() const } +LSEQ LSET::TechAndUserUIOrder() const +{ + static const PCB_LAYER_ID sequence[] = { + F_Adhes, + B_Adhes, + F_Paste, + B_Paste, + F_SilkS, + B_SilkS, + F_Mask, + B_Mask, + Dwgs_User, + Cmts_User, + Eco1_User, + Eco2_User, + Edge_Cuts, + Margin, + F_CrtYd, + B_CrtYd, + F_Fab, + B_Fab, + }; + + return Seq( sequence, DIM( sequence ) ); +} + + std::string LSET::FmtBin() const { std::string ret; @@ -758,16 +785,11 @@ LSET LSET::BackMask() LSEQ LSET::UIOrder() const { - PCB_LAYER_ID order[PCB_LAYER_ID_COUNT]; - - // Assmuming that the PCB_LAYER_ID order is according to preferred UI order, as of - // today this is true. When that becomes not true, its easy to change the order - // in here to compensate. - - for( unsigned i=0; i