Commit b525e3be authored by Lorenzo Marcantonio's avatar Lorenzo Marcantonio
Browse files

Factored out text anchor drawing

More layer classification cleanup
parent 0de48234
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -106,14 +106,14 @@ void LAYER_BOX_SELECTOR::ResyncBitmapOnly()
}


void LAYER_BOX_SELECTOR::SetBitmapLayer( wxBitmap& aLayerbmp, LAYER_NUM aLayerIndex )
void LAYER_BOX_SELECTOR::SetBitmapLayer( wxBitmap& aLayerbmp, LAYER_NUM aLayer )
{
    wxMemoryDC bmpDC;
    wxBrush    brush;

    // Prepare Bitmap
    bmpDC.SelectObject( aLayerbmp );
    brush.SetColour( MakeColour( GetLayerColor( aLayerIndex ) ) );
    brush.SetColour( MakeColour( GetLayerColor( aLayer ) ) );
    brush.SetStyle( wxSOLID );

    bmpDC.SetBrush( brush );
+1 −1
Original line number Diff line number Diff line
@@ -29,7 +29,7 @@
#include <cstdlib>         // bsearch()
#include <cctype>


#include <macros.h>
#include <dsnlexer.h>

//#include "fctsys.h"
+4 −14
Original line number Diff line number Diff line
@@ -269,22 +269,12 @@ void EDA_TEXT::DrawOneLineOfText( EDA_DRAW_PANEL* aPanel, wxDC* aDC,
    if( aDrawMode != -1 )
        GRSetDrawMode( aDC, aDrawMode );

    /* Draw text anchor, if allowed */
    // Draw text anchor, if requested
    if( aAnchor_color != UNSPECIFIED_COLOR )
    {

        int anchor_size = aDC->DeviceToLogicalXRel( 2 );

        aAnchor_color = (EDA_COLOR_T) ( aAnchor_color & MASKCOLOR );

        int cX = aPos.x + aOffset.x;
        int cY = aPos.y + aOffset.y;

        GRLine( aPanel->GetClipBox(), aDC, cX - anchor_size, cY,
                cX + anchor_size, cY, 0, aAnchor_color );

        GRLine( aPanel->GetClipBox(), aDC, cX, cY - anchor_size,
                cX, cY + anchor_size, 0, aAnchor_color );
        GRDrawAnchor( aPanel->GetClipBox(), aDC,
                      aPos.x + aOffset.x, aPos.y + aOffset.y,
                      DIM_ANCRE_TEXTE, aAnchor_color );
    }

    if( aFillMode == SKETCH )
+13 −0
Original line number Diff line number Diff line
@@ -1551,3 +1551,16 @@ EDA_COLOR_T ColorFindNearest( const wxColour &aColor )

    return candidate;
}

void GRDrawAnchor( EDA_RECT *aClipBox, wxDC *aDC, int x, int y, 
                   int aSize, EDA_COLOR_T aColor )
{
        int anchor_size = aDC->DeviceToLogicalXRel( aSize );

        GRLine( aClipBox, aDC,
                x - anchor_size, y,
                x + anchor_size, y, 0, aColor );
        GRLine( aClipBox, aDC,
                x, y - anchor_size,
                x, y + anchor_size, 0, aColor );
}
+1 −0
Original line number Diff line number Diff line
@@ -30,6 +30,7 @@
#include <wxstruct.h>
#include <dialog_helpers.h>
#include <base_units.h>
#include <macros.h>


/*******************************************************/
Loading