Browse Source
Fix obscured object selection issue in board and footprint editors.
Fix obscured object selection issue in board and footprint editors.
This selection improvement feature is hidden behind the advanced configuration key "PcbSelectionVisibilityRatio". It is turned off (1.0) by default. Value values are from 0.0 to less that 1.0. From testing, using a value between 0.1 and 0.3 produces the best results. This fix uses normal alpha blending described in the link below. The current design only uses the alpha of the object's color. It could be improved by doing a full color alpha blending but using the color alpha alone seems to result in satisfactory results. https://en.wikipedia.org/wiki/Alpha_compositing Fixes https://gitlab.com/kicad/code/kicad/-/issues/16126newinvert
7 changed files with 254 additions and 5 deletions
-
8common/advanced_config.cpp
-
12include/advanced_config.h
-
11include/layer_ids.h
-
178pcbnew/tools/pcb_selection_tool.cpp
-
4pcbnew/tools/pcb_selection_tool.h
-
1qa/tests/common/CMakeLists.txt
-
45qa/tests/common/test_layer_ids.cpp
@ -0,0 +1,45 @@ |
|||
/*
|
|||
* This program source code file is part of KiCad, a free EDA CAD application. |
|||
* |
|||
* Copyright (C) 2023 Wayne Stambaugh <stambaughw@gmail.com> |
|||
* Copyright (C) 2023 KiCad Developers, see AUTHORS.txt for contributors. |
|||
* |
|||
* This program is free software: you can redistribute it and/or modify it |
|||
* under the terms of the GNU General Public License as published by the |
|||
* Free Software Foundation, either version 3 of the License, or (at your |
|||
* option) any later version. |
|||
* |
|||
* This program is distributed in the hope that it will be useful, but |
|||
* WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|||
* General Public License for more details. |
|||
* |
|||
* You should have received a copy of the GNU General Public License along |
|||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
#include <boost/test/unit_test.hpp>
|
|||
#include <layer_ids.h>
|
|||
|
|||
|
|||
BOOST_AUTO_TEST_SUITE( LayerIds ) |
|||
|
|||
|
|||
BOOST_AUTO_TEST_CASE( LseqTestLayers ) |
|||
{ |
|||
LSET allLayers = LSET::AllLayersMask(); |
|||
LSEQ seq1 = allLayers.SeqStackupTop2Bottom(); |
|||
|
|||
BOOST_CHECK_EQUAL( seq1.TestLayers( PCB_LAYER_ID::F_Cu, PCB_LAYER_ID::F_Cu ), 0 ); |
|||
BOOST_CHECK_GT( seq1.TestLayers( PCB_LAYER_ID::F_Cu, PCB_LAYER_ID::In1_Cu ), 0 ); |
|||
BOOST_CHECK_LT( seq1.TestLayers( PCB_LAYER_ID::In1_Cu, PCB_LAYER_ID::F_Cu ), 0 ); |
|||
|
|||
// Pretend like inner copper layer one is the currently selected layer.
|
|||
LSEQ seq2 = allLayers.SeqStackupTop2Bottom( PCB_LAYER_ID::In1_Cu ); |
|||
BOOST_CHECK_LT( seq2.TestLayers( PCB_LAYER_ID::F_Cu, PCB_LAYER_ID::In1_Cu ), 0 ); |
|||
BOOST_CHECK_GT( seq2.TestLayers( PCB_LAYER_ID::In1_Cu, PCB_LAYER_ID::F_Cu ), 0 ); |
|||
} |
|||
|
|||
|
|||
BOOST_AUTO_TEST_SUITE_END() |
|||
|
Write
Preview
Loading…
Cancel
Save
Reference in new issue