Commit 9ebb4afa authored by Lorenzo Marcantonio's avatar Lorenzo Marcantonio
Browse files

Removed arbitrary MAX_LAYER_ROWS limit (only used in one assertion, anyway)

parent 150cfebb
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -174,7 +174,7 @@ int LAYER_WIDGET::encodeId( int aColumn, int aId )
}


int LAYER_WIDGET::getDecodedId( int aControlId )
LAYER_NUM LAYER_WIDGET::getDecodedId( int aControlId )
{
    int id = aControlId / LYR_COLUMN_COUNT;    // rounding is OK.
    return id;
@@ -319,7 +319,7 @@ void LAYER_WIDGET::OnMiddleDownRenderColor( wxMouseEvent& event )
        wxBitmap bm = makeBitmap( newColor );
        eventSource->SetBitmapLabel( bm );

        int id = getDecodedId( eventSource->GetId() );
        LAYER_NUM id = getDecodedId( eventSource->GetId() );

        // tell the client code.
        OnRenderColorChange( id, newColor );
@@ -331,7 +331,7 @@ void LAYER_WIDGET::OnMiddleDownRenderColor( wxMouseEvent& event )
void LAYER_WIDGET::OnRenderCheckBox( wxCommandEvent& event )
{
    wxCheckBox* eventSource = (wxCheckBox*) event.GetEventObject();
    int id = getDecodedId( eventSource->GetId() );
    LAYER_NUM id = getDecodedId( eventSource->GetId() );
    OnRenderEnable( id, eventSource->IsChecked() );
    passOnFocus();
}
@@ -398,7 +398,7 @@ int LAYER_WIDGET::findRenderRow( int aId ) const

void LAYER_WIDGET::insertLayerRow( int aRow, const ROW& aSpec )
{
    wxASSERT( aRow >= 0 && aRow < MAX_LAYER_ROWS );
    wxASSERT( aRow >= 0 );

    int         col;
    int         index = aRow * LYR_COLUMN_COUNT;
@@ -440,7 +440,7 @@ void LAYER_WIDGET::insertLayerRow( int aRow, const ROW& aSpec )

void LAYER_WIDGET::insertRenderRow( int aRow, const ROW& aSpec )
{
    wxASSERT( aRow >= 0 && aRow < MAX_LAYER_ROWS );
    wxASSERT( aRow >= 0 );

    int         col;
    int         index = aRow * RND_COLUMN_COUNT;
+8 −4
Original line number Diff line number Diff line
@@ -62,6 +62,10 @@
 * <p> void OnLayerVisible( int aLayer, bool isVisible );
 * <p> void OnRenderColorChange( int id, int aColor );
 * <p> void OnRenderEnable( int id, bool isEnabled );
 *
 * Please note that even if designed toward layers, it is used to
 * contain other stuff, too (the second page in pcbnew contains render
 * items, for example)
 */
class LAYER_WIDGET : public wxPanel
{
@@ -133,9 +137,11 @@ protected:

    /**
     * Function getDecodedId
     * decodes \a aControlId to original un-encoded value.
     * decodes \a aControlId to original un-encoded value. This of
     * course holds iff encodedId was called with a LAYER_NUM (this box
     * is used for other things than layers, too)
     */
    static int getDecodedId( int aControlId );
    static LAYER_NUM getDecodedId( int aControlId );

    /**
     * Function makeColorButton
@@ -243,8 +249,6 @@ public:
     */
    void AppendLayerRow( const ROW& aRow );

#define MAX_LAYER_ROWS          64  ///< cannot append more than this number of rows

    /**
     * Function AppendLayerRows
     * appends new rows in the layer portion of the widget.  The user must
+2 −2

File changed.

Contains only whitespace changes.