Commit 54b56123 authored by charras's avatar charras
Browse files

Uses a buffered DC in OnPaint event. Seems solve slow grid redraw on some PC.

parent 9d81025e
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -4,6 +4,14 @@ KiCad ChangeLog 2009
Please add newer entries at the top, list the date and your name with
email address.

2010-Jan-12 UPDATE Jean-Pierre Charras <jean-pierre.charras@gipsa-lab.inpg.fr>
================================================================================
++All
    Use wxAutoBufferedPaintDC in OnPaint event
    Seems solves slow grid redraw on some PC (tested under Window 7)
    and is faster than use wxPaintDC, not buffered
    (note MACOSX has natively a double buffer, so no change for MACOSX)

2010-Jan-08 UPDATE Jean-Pierre Charras <jean-pierre.charras@gipsa-lab.inpg.fr>
================================================================================
++Gerbview
+2 −1
Original line number Diff line number Diff line
@@ -139,7 +139,8 @@ check_find_package_result(OPENGL_FOUND "OpenGL")
# http://www.wxwidgets.org/manuals/2.8/wx_librarieslist.html

if( KICAD_AUIMANAGER OR KICAD_AUITOOLBAR )
    find_package(wxWidgets COMPONENTS gl html adv core net base aui QUIET)
#    find_package(wxWidgets COMPONENTS gl html adv core net base aui QUIET)
    find_package(wxWidgets COMPONENTS gl html adv core net base QUIET)
else( KICAD_AUIMANAGER OR KICAD_AUITOOLBAR )
    find_package(wxWidgets COMPONENTS gl html adv core net base QUIET)
endif( KICAD_AUIMANAGER OR KICAD_AUITOOLBAR )
+0 −6
Original line number Diff line number Diff line
@@ -421,12 +421,6 @@ void WinEDA_DrawPanel::OnActivate( wxActivateEvent& event )
}


void WinEDA_DrawPanel::OnEraseBackground( wxEraseEvent& event )
{
    event.Skip();
}


void WinEDA_DrawPanel::OnScroll( wxScrollWinEvent& event )
{
    int id = event.GetEventType();
+19 −23
Original line number Diff line number Diff line
@@ -15,8 +15,6 @@
#include "class_base_screen.h"
#include "wxstruct.h"

#include "kicad_device_context.h"

/** Compute draw offset (scroll bars and draw parameters)
 *  in order to have the current graphic cursor position at the screen center
 *  @param ToMouse if TRUE, the mouse cursor is moved
@@ -28,8 +26,8 @@ void WinEDA_DrawFrame::Recadre_Trace( bool ToMouse )
{
    PutOnGrid( &(GetBaseScreen()->m_Curseur) );
    AdjustScrollBars();
    INSTALL_DC( dc, DrawPanel ) ;
    DrawPanel->ReDraw( &dc );
    DrawPanel->Refresh();   // send OnPaint event
    wxSafeYield();          // needed to allow OnPaint event execution here

    /* Move the mouse cursor to the on grid graphic cursor position */
    if( ToMouse == TRUE )
@@ -79,6 +77,7 @@ void WinEDA_DrawFrame::Window_Zoom( EDA_Rect& Rect )
    /* Compute the best zoom */
    Rect.Normalize();
    size = DrawPanel->GetClientSize();

    // Use ceil to at least show the full rect
    scalex    = (double) Rect.GetSize().x / size.x;
    bestscale = (double) Rect.GetSize().y / size.y;
@@ -107,6 +106,7 @@ void WinEDA_DrawFrame::OnZoom( wxCommandEvent& event )
    {
    case ID_POPUP_ZOOM_IN:
        zoom_at_cursor = true;

    // fall thru

    case ID_ZOOM_IN:
@@ -118,6 +118,7 @@ void WinEDA_DrawFrame::OnZoom( wxCommandEvent& event )

    case ID_POPUP_ZOOM_OUT:
        zoom_at_cursor = true;

    // fall thru

    case ID_ZOOM_OUT:
@@ -128,12 +129,7 @@ void WinEDA_DrawFrame::OnZoom( wxCommandEvent& event )
        break;

    case ID_ZOOM_REDRAW:
        // DrawPanel->Refresh(); usually good,
        // but does not work under linux, when called from here (wxGTK bug ?)
        {
        INSTALL_DC( dc, DrawPanel );
        DrawPanel->ReDraw( &dc );
        }
        DrawPanel->Refresh();
        break;

    case ID_POPUP_ZOOM_CENTER:
+0 −1
Original line number Diff line number Diff line
@@ -99,7 +99,6 @@ public:
                            void* aData );
    void         DrawBackGround( wxDC* DC );
    void         DrawAuxiliaryAxis( wxDC* DC, int drawmode );
    void         OnEraseBackground( wxEraseEvent& event );
    void         OnActivate( wxActivateEvent& event );

    /* Mouse and keys events */
Loading