Commit 16437e5d authored by Maciej Suminski's avatar Maciej Suminski
Browse files

Added general purpose overlay layer and moved selection box to it.

parent 8c37e708
Loading
Loading
Loading
Loading
+3 −0
Original line number Original line Diff line number Diff line
@@ -240,6 +240,8 @@ enum PCB_VISIBLE
    PAD_BK_NETNAMES_VISIBLE,
    PAD_BK_NETNAMES_VISIBLE,
    PADS_NETNAMES_VISIBLE,
    PADS_NETNAMES_VISIBLE,


    GP_OVERLAY,                 // General purpose overlay

    END_PCB_VISIBLE_LIST  // sentinel
    END_PCB_VISIBLE_LIST  // sentinel
};
};


@@ -256,6 +258,7 @@ enum PCB_VISIBLE
/// means that layer is displayed closer to the user, ie. on the top).
/// means that layer is displayed closer to the user, ie. on the top).
const LAYER_NUM GalLayerOrder[] =
const LAYER_NUM GalLayerOrder[] =
{
{
    ITEM_GAL_LAYER( GP_OVERLAY ),
    ITEM_GAL_LAYER( PADS_NETNAMES_VISIBLE ),
    ITEM_GAL_LAYER( PADS_NETNAMES_VISIBLE ),
    DRAW_N, COMMENT_N, ECO1_N, ECO2_N, EDGE_N,
    DRAW_N, COMMENT_N, ECO1_N, ECO2_N, EDGE_N,
    UNUSED_LAYER_29, UNUSED_LAYER_30, UNUSED_LAYER_31,
    UNUSED_LAYER_29, UNUSED_LAYER_30, UNUSED_LAYER_31,
+1 −0
Original line number Original line Diff line number Diff line
@@ -831,6 +831,7 @@ void PCB_BASE_FRAME::LoadSettings()
    view->SetRequired( ITEM_GAL_LAYER( PADS_NETNAMES_VISIBLE ), ITEM_GAL_LAYER( PADS_VISIBLE ) );
    view->SetRequired( ITEM_GAL_LAYER( PADS_NETNAMES_VISIBLE ), ITEM_GAL_LAYER( PADS_VISIBLE ) );
    view->SetRequired( ITEM_GAL_LAYER( PAD_FR_NETNAMES_VISIBLE ), ITEM_GAL_LAYER( PAD_FR_VISIBLE ) );
    view->SetRequired( ITEM_GAL_LAYER( PAD_FR_NETNAMES_VISIBLE ), ITEM_GAL_LAYER( PAD_FR_VISIBLE ) );
    view->SetRequired( ITEM_GAL_LAYER( PAD_BK_NETNAMES_VISIBLE ), ITEM_GAL_LAYER( PAD_BK_VISIBLE ) );
    view->SetRequired( ITEM_GAL_LAYER( PAD_BK_NETNAMES_VISIBLE ), ITEM_GAL_LAYER( PAD_BK_VISIBLE ) );
    view->SetLayerTarget( ITEM_GAL_LAYER( GP_OVERLAY ), KiGfx::TARGET_OVERLAY );


    // Apply layer coloring scheme & display options
    // Apply layer coloring scheme & display options
    if( view->GetPainter() )
    if( view->GetPainter() )
+8 −10
Original line number Original line Diff line number Diff line
@@ -49,13 +49,11 @@ void SELECTION_AREA::ViewGetLayers( int aLayers[], int& aCount ) const


void SELECTION_AREA::ViewDraw( int aLayer, GAL* aGal, const BOX2I& aVisibleArea ) const
void SELECTION_AREA::ViewDraw( int aLayer, GAL* aGal, const BOX2I& aVisibleArea ) const
{
{
    VECTOR2D width = m_view->ToWorld( VECTOR2D( 1.0, 1.0 ), false ); // fixme: pixel-sized stroke width setting?
    aGal->SetLineWidth( 1.0 );
    aGal->SetLineWidth( width.x );
    aGal->SetStrokeColor( COLOR4D( 1.0, 1.0, 0.4, 1.0 ) );
    aGal->SetStrokeColor( COLOR4D( 1.0, 1.0, 0.4, 1.0 ) );
    aGal->SetFillColor( COLOR4D( 0.3, 0.3, 0.5, 0.3 ) );
    aGal->SetFillColor( COLOR4D( 0.3, 0.3, 0.5, 0.3 ) );
    aGal->SetIsStroke( true );
    aGal->SetIsStroke( true );
    aGal->SetIsFill( true );
    aGal->SetIsFill( true );
    aGal->SetLayerDepth(100.0);
    aGal->DrawRectangle( m_origin, m_end );
    aGal->DrawRectangle( m_origin, m_end );
}
}


+3 −2
Original line number Original line Diff line number Diff line
@@ -33,6 +33,7 @@
#include <view/view.h>
#include <view/view.h>
#include <gal/graphics_abstraction_layer.h>
#include <gal/graphics_abstraction_layer.h>
#include <base_struct.h>
#include <base_struct.h>
#include <layers_id_colors_and_visibility.h>


/**
/**
 * Class SELECTION_AREA
 * Class SELECTION_AREA
@@ -42,7 +43,7 @@
class SELECTION_AREA : public EDA_ITEM
class SELECTION_AREA : public EDA_ITEM
{
{
public:
public:
    static const int SelectionLayer = 126;		// fixme: define globally
    static const int SelectionLayer = ITEM_GAL_LAYER( GP_OVERLAY );


    SELECTION_AREA();
    SELECTION_AREA();
    ~SELECTION_AREA() {};
    ~SELECTION_AREA() {};
+0 −4
Original line number Original line Diff line number Diff line
@@ -199,10 +199,6 @@ void SELECTION_TOOL::selectMultiple()
            m_selArea->SetEnd( evt->Position() );
            m_selArea->SetEnd( evt->Position() );
            m_selArea->ViewSetVisible( true );
            m_selArea->ViewSetVisible( true );
            m_selArea->ViewUpdate( VIEW_ITEM::APPEARANCE | VIEW_ITEM::GEOMETRY );
            m_selArea->ViewUpdate( VIEW_ITEM::APPEARANCE | VIEW_ITEM::GEOMETRY );

            v->SetLayerVisible( SELECTION_AREA::SelectionLayer );
            v->SetLayerOrder( SELECTION_AREA::SelectionLayer, 1000 );
            v->SetLayerTarget( SELECTION_AREA::SelectionLayer, TARGET_OVERLAY );
        }
        }


        if( evt->IsMouseUp( MB_Left ) )
        if( evt->IsMouseUp( MB_Left ) )