From 5813a12ebb277bfa032d78ea3559c33cde3862a4 Mon Sep 17 00:00:00 2001 From: charras Date: Sat, 31 Jan 2009 10:05:16 +0000 Subject: [PATCH] Print functions and display zoom level modified to use the new zoom implementation Comments added in some functions. --- CHANGELOG.txt | 6 ++ common/base_screen.cpp | 8 +- common/drawframe.cpp | 12 ++- common/drawpanel.cpp | 8 +- common/drawtxt.cpp | 1 - common/zoom.cpp | 6 +- eeschema/component_class.cpp | 4 - eeschema/controle.cpp | 111 +++++++++++++----------- eeschema/dialog_SVG_print.cpp | 2 +- eeschema/dialog_print_using_printer.cpp | 4 +- include/drawpanel_wxstruct.h | 37 +++++++- include/wxstruct.h | 2 +- pcbnew/basepcbframe.cpp | 3 + pcbnew/dialog_SVG_print.cpp | 2 +- pcbnew/dialog_print_using_printer.cpp | 4 +- pcbnew/tool_pcb.cpp | 9 +- 16 files changed, 138 insertions(+), 81 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index d780c7d8d8..5fb46cc314 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -5,6 +5,12 @@ Started 2007-June-11 Please add newer entries at the top, list the date and your name with email address. +2009-jan-31 UPDATE Jean-Pierre Charras +================================================================================ +++All: + Print functions and display zoom level modified to use the new zoom implementation + Comments adde in some functions. + 2009-Jan-29 UPDATE Wayne Stambaugh ================================================================================ ++All diff --git a/common/base_screen.cpp b/common/base_screen.cpp index e43a4185d9..5c00b05044 100644 --- a/common/base_screen.cpp +++ b/common/base_screen.cpp @@ -105,13 +105,13 @@ wxSize BASE_SCREEN::ReturnPageSize( void ) /******************************************************************/ wxPoint BASE_SCREEN::CursorRealPosition( const wxPoint& ScreenPos ) /******************************************************************/ +/** Function CursorRealPosition + * @return the position in user units of location ScreenPos + * @param ScreenPos = the screen (in pixel) position co convert +*/ { wxPoint curpos = ScreenPos; Unscale( curpos ); -// D(printf("curpos=%d,%d GetZoom=%d, mDrawOrg=%d,%d\n", curpos.x, curpos.y, GetZoom(), m_DrawOrg.x, m_DrawOrg.y );) - -// curpos.x = Unscale( ScreenPos.x ); -// curpos.y = Unscale( ScreenPos.y ); curpos += m_DrawOrg; diff --git a/common/drawframe.cpp b/common/drawframe.cpp index 195fa8a23e..94a2eddcf1 100644 --- a/common/drawframe.cpp +++ b/common/drawframe.cpp @@ -335,7 +335,7 @@ void WinEDA_DrawFrame::SetToolbars() /********************************************************/ -void WinEDA_DrawFrame::DisplayToolMsg( const wxString msg ) +void WinEDA_DrawFrame::DisplayToolMsg( const wxString& msg ) /********************************************************/ { SetStatusText( msg, 5 ); @@ -695,10 +695,14 @@ void WinEDA_DrawFrame::Affiche_Status_Box() if( !screen ) return; - /* affichage Zoom et coordonnees absolues */ - Line.Printf( wxT( "Z %d" ), screen->GetZoom() ); + /* Display Zoom level: zoom = zoom_coeff/ZoomScalar */ + if ( (screen->GetZoom() % screen->m_ZoomScalar) == 0 ) + Line.Printf( wxT( "Z %d" ),screen->GetZoom() / screen->m_ZoomScalar ); + else + Line.Printf( wxT( "Z %.1f" ), (float)screen->GetZoom() / screen->m_ZoomScalar ); SetStatusText( Line, 1 ); + /* Display absolute coordinates: */ Line.Printf( g_UnitMetric ? wxT( "X %.3f Y %.3f" ) : wxT( "X %.4f Y %.4f" ), To_User_Unit( g_UnitMetric, screen->m_Curseur.x, m_InternalUnits ), @@ -706,7 +710,7 @@ void WinEDA_DrawFrame::Affiche_Status_Box() m_InternalUnits ) ); SetStatusText( Line, 2 ); - /* affichage des coordonnees relatives */ + /* Display relative coordinates: */ dx = screen->m_Curseur.x - screen->m_O_Curseur.x; dy = screen->m_Curseur.y - screen->m_O_Curseur.y; diff --git a/common/drawpanel.cpp b/common/drawpanel.cpp index a1e53dc484..9b2e2f16e6 100644 --- a/common/drawpanel.cpp +++ b/common/drawpanel.cpp @@ -184,7 +184,7 @@ void WinEDA_DrawPanel::PrepareGraphicContext( wxDC* DC ) GRResetPenAndBrush( DC ); DC->SetBackgroundMode( wxTRANSPARENT ); #ifdef WX_ZOOM - double scale = 1.0 / (double) GetZoom(); + double scale = GetScreen()->GetScalingFactor( ); DC->SetUserScale( scale, scale ); DoPrepareDC( *DC ); #endif @@ -306,8 +306,8 @@ void WinEDA_DrawPanel::ConvertPcbUnitsToPixelsUnits( wxPoint* aPosition ) wxPoint WinEDA_DrawPanel::CursorScreenPosition() /********************************************************/ -/** CursorScreenPosition - * @return the curseur position in pixels in the panel draw area on screen ) +/** Function CursorScreenPosition + * @return the curseur current position in pixels in the screen draw area */ { wxPoint pos = GetScreen()->m_Curseur; @@ -609,7 +609,7 @@ void WinEDA_DrawPanel::ReDraw( wxDC* DC, bool erasebg ) } #ifdef WX_ZOOM - double scale = 1.0 / (double) GetZoom(); + double scale = Screen->GetScalingFactor( ); DC->SetUserScale( scale, scale ); #endif diff --git a/common/drawtxt.cpp b/common/drawtxt.cpp index 5c4dbe8180..0e247e98bb 100644 --- a/common/drawtxt.cpp +++ b/common/drawtxt.cpp @@ -32,7 +32,6 @@ void DrawGraphicText( WinEDA_DrawPanel* aPanel, wxDC* aDC, /****************************************************************************************************/ /** Function DrawGraphicText - * Draw a graphic text (like module texts) * Draw a graphic text (like module texts) * @param aPanel = the current DrawPanel. NULL if draw within a 3D GL Canvas * @param aDC = the current Device Context. NULL if draw within a 3D GL Canvas diff --git a/common/zoom.cpp b/common/zoom.cpp index 13a3a1de6b..3db40c40db 100644 --- a/common/zoom.cpp +++ b/common/zoom.cpp @@ -226,7 +226,11 @@ void WinEDA_DrawPanel::AddMenuZoom( wxMenu* MasterMenu ) /* Populate zoom submenu. */ for( i = 0; i < (size_t) maxZoomIds; i++ ) { - msg.Printf( wxT( "%u" ), GetScreen()->m_ZoomList[i] ); + if ( (GetScreen()->m_ZoomList[i] % GetScreen()->m_ZoomScalar) == 0 ) + msg.Printf( wxT( "%u" ), GetScreen()->m_ZoomList[i] / GetScreen()->m_ZoomScalar); + else + msg.Printf(wxT("%.1f"),(float)GetScreen()->m_ZoomList[i] / GetScreen()->m_ZoomScalar ); + zoom_choice->Append( ID_POPUP_ZOOM_LEVEL_START + i, _( "Zoom: " ) + msg, wxEmptyString, wxITEM_CHECK ); if( zoom == GetScreen()->m_ZoomList[i] ) diff --git a/eeschema/component_class.cpp b/eeschema/component_class.cpp index 9a0752d232..909d94e49e 100644 --- a/eeschema/component_class.cpp +++ b/eeschema/component_class.cpp @@ -18,10 +18,6 @@ WX_DEFINE_OBJARRAY( ArrayOfSheetLists ); -/***************************/ -/* class SCH_COMPONENT */ -/***************************/ - /*******************************************************************/ SCH_COMPONENT::SCH_COMPONENT( const wxPoint& aPos, SCH_ITEM* aParent ) : diff --git a/eeschema/controle.cpp b/eeschema/controle.cpp index 1daf19f15c..09bad06ac0 100644 --- a/eeschema/controle.cpp +++ b/eeschema/controle.cpp @@ -17,28 +17,31 @@ #include "protos.h" -/**************************************************************/ -SCH_ITEM * WinEDA_SchematicFrame:: SchematicGeneralLocateAndDisplay( bool IncludePin ) -/**************************************************************/ +/**************************************************************************************/ +SCH_ITEM* WinEDA_SchematicFrame:: SchematicGeneralLocateAndDisplay( bool IncludePin ) +/**************************************************************************************/ -/* Routine de localisation et d'affichage des caract (si utile ) - * de l'element pointe par la souris ou par le curseur pcb - * - marqueur +/** Function SchematicGeneralLocateAndDisplay + * Overlayed function + * Find the schematic item at cursor position + * the priority order is: + * - marker * - noconnect - * - jonction + * - junction * - wire/bus/entry * - label - * - composant * - pin - * retourne - * un pointeur sur le composant - * Null sinon + * - component + * @return an EDA_BaseStruct pointer on the item or NULL if no item found + * @param IncludePin = true to search for pins, fase to ignore them + * + * For some items, caracteristics are displayed on the screen. */ { - SCH_ITEM* DrawStruct; - wxString msg; - wxPoint mouse_position = GetScreen()->m_MousePosition; - LibDrawPin* Pin = NULL; + SCH_ITEM* DrawStruct; + wxString msg; + wxPoint mouse_position = GetScreen()->m_MousePosition; + LibDrawPin* Pin = NULL; SCH_COMPONENT* LibItem = NULL; DrawStruct = SchematicGeneralLocateAndDisplay( mouse_position, IncludePin ); @@ -55,7 +58,7 @@ SCH_ITEM * WinEDA_SchematicFrame:: SchematicGeneralLocateAndDisplay( bool Includ case DRAW_PART_TEXT_STRUCT_TYPE: case COMPONENT_FIELD_DRAW_TYPE: LibItem = (SCH_COMPONENT*) DrawStruct->GetParent(); - SendMessageToPCBNEW( DrawStruct,LibItem ); + SendMessageToPCBNEW( DrawStruct, LibItem ); break; case TYPE_SCH_COMPONENT: @@ -81,8 +84,8 @@ SCH_ITEM * WinEDA_SchematicFrame:: SchematicGeneralLocateAndDisplay( bool Includ Pin->Display_Infos( this ); if( LibItem ) Affiche_1_Parametre( this, 1, - LibItem->GetRef(GetSheet()), - LibItem->GetField(VALUE)->m_Text, + LibItem->GetRef( GetSheet() ), + LibItem->GetField( VALUE )->m_Text, CYAN ); // Cross probing:2 - pin found, and send a locate pin command to pcbnew (hightlight net) @@ -92,11 +95,14 @@ SCH_ITEM * WinEDA_SchematicFrame:: SchematicGeneralLocateAndDisplay( bool Includ } -/************************************************************************************/ -SCH_ITEM* WinEDA_SchematicFrame:: SchematicGeneralLocateAndDisplay( const wxPoint& refpoint, bool IncludePin ) -/************************************************************************************/ +/********************************************************************************************/ +SCH_ITEM* WinEDA_SchematicFrame:: SchematicGeneralLocateAndDisplay( const wxPoint& refpoint, + bool IncludePin ) +/********************************************************************************************/ -/* Find the schematic item at position "refpoint" +/** Function SchematicGeneralLocateAndDisplay + * Overlayed function + * Find the schematic item at a given position * the priority order is: * - marker * - noconnect @@ -105,19 +111,19 @@ SCH_ITEM* WinEDA_SchematicFrame:: SchematicGeneralLocateAndDisplay( const wxPoin * - label * - pin * - component - * return: - * an EDA_BaseStruct pointer on the item - * a Null pointer if no item found + * @return an EDA_BaseStruct pointer on the item or NULL if no item found + * @param refpoint = the wxPoint loaction where to search + * @param IncludePin = true to search for pins, fase to ignore them * * For some items, caracteristics are displayed on the screen. */ { - SCH_ITEM* DrawStruct; - LibDrawPin* Pin; + SCH_ITEM* DrawStruct; + LibDrawPin* Pin; SCH_COMPONENT* LibItem; - wxString Text; - wxString msg; - int ii; + wxString Text; + wxString msg; + int ii; DrawStruct = (SCH_ITEM*) PickStruct( refpoint, GetScreen(), MARKERITEM ); if( DrawStruct ) @@ -147,7 +153,7 @@ SCH_ITEM* WinEDA_SchematicFrame:: SchematicGeneralLocateAndDisplay( const wxPoin } DrawStruct = (SCH_ITEM*) PickStruct( refpoint, GetScreen(), WIREITEM | BUSITEM | RACCORDITEM ); - if( DrawStruct ) // Search for a pin + if( DrawStruct ) // We have found a wire: Search for a connected pin at the same location { Pin = LocateAnyPin( (SCH_ITEM*) m_CurrentSheet->LastDrawList(), refpoint, &LibItem ); if( Pin ) @@ -155,8 +161,8 @@ SCH_ITEM* WinEDA_SchematicFrame:: SchematicGeneralLocateAndDisplay( const wxPoin Pin->Display_Infos( this ); if( LibItem ) Affiche_1_Parametre( this, 1, - LibItem->GetRef(GetSheet()), - LibItem->GetField(VALUE)->m_Text, + LibItem->GetRef( GetSheet() ), + LibItem->GetField( VALUE )->m_Text, CYAN ); } else @@ -181,8 +187,8 @@ SCH_ITEM* WinEDA_SchematicFrame:: SchematicGeneralLocateAndDisplay( const wxPoin Pin->Display_Infos( this ); if( LibItem ) Affiche_1_Parametre( this, 1, - LibItem->GetRef(GetSheet()), - LibItem->GetField(VALUE)->m_Text, + LibItem->GetRef( GetSheet() ), + LibItem->GetField( VALUE )->m_Text, CYAN ); if( IncludePin == TRUE ) return LibItem; @@ -191,13 +197,13 @@ SCH_ITEM* WinEDA_SchematicFrame:: SchematicGeneralLocateAndDisplay( const wxPoin DrawStruct = (SCH_ITEM*) PickStruct( refpoint, GetScreen(), LIBITEM ); if( DrawStruct ) { - DrawStruct = LocateSmallestComponent( (SCH_SCREEN*)GetScreen() ); + DrawStruct = LocateSmallestComponent( (SCH_SCREEN*) GetScreen() ); LibItem = (SCH_COMPONENT*) DrawStruct; LibItem->Display_Infos( this ); return DrawStruct; } - DrawStruct = (SCH_ITEM*)PickStruct( refpoint, GetScreen(), SHEETITEM ); + DrawStruct = (SCH_ITEM*) PickStruct( refpoint, GetScreen(), SHEETITEM ); if( DrawStruct ) { ( (DrawSheetStruct*) DrawStruct )->Display_Infos( this ); @@ -205,7 +211,7 @@ SCH_ITEM* WinEDA_SchematicFrame:: SchematicGeneralLocateAndDisplay( const wxPoin } // Recherche des autres elements - DrawStruct = (SCH_ITEM*)PickStruct( refpoint, GetScreen(), SEARCHALL ); + DrawStruct = (SCH_ITEM*) PickStruct( refpoint, GetScreen(), SEARCHALL ); if( DrawStruct ) { return DrawStruct; @@ -220,10 +226,10 @@ SCH_ITEM* WinEDA_SchematicFrame:: SchematicGeneralLocateAndDisplay( const wxPoin void WinEDA_SchematicFrame::GeneralControle( wxDC* DC, wxPoint MousePositionInPixels ) /*************************************************************************************/ { - wxSize delta; - SCH_SCREEN* screen = GetScreen(); - wxPoint curpos, oldpos; - int hotkey = 0; + wxSize delta; + SCH_SCREEN* screen = GetScreen(); + wxPoint curpos, oldpos; + int hotkey = 0; ActiveScreen = screen; @@ -305,7 +311,7 @@ void WinEDA_SchematicFrame::GeneralControle( wxDC* DC, wxPoint MousePositionInPi OnHotKey( DC, hotkey, NULL ); } - Affiche_Status_Box(); /* Affichage des coord curseur */ + Affiche_Status_Box(); /* Display cursor coordintes info */ SetToolbars(); } @@ -314,10 +320,10 @@ void WinEDA_SchematicFrame::GeneralControle( wxDC* DC, wxPoint MousePositionInPi void WinEDA_LibeditFrame::GeneralControle( wxDC* DC, wxPoint MousePositionInPixels ) /*************************************************************************************/ { - wxSize delta; - SCH_SCREEN* screen = GetScreen(); - wxPoint curpos, oldpos; - int hotkey = 0; + wxSize delta; + SCH_SCREEN* screen = GetScreen(); + wxPoint curpos, oldpos; + int hotkey = 0; ActiveScreen = screen; @@ -403,14 +409,15 @@ void WinEDA_LibeditFrame::GeneralControle( wxDC* DC, wxPoint MousePositionInPixe SetToolbars(); } + /*****************************************************************************/ -void WinEDA_ViewlibFrame::GeneralControle( wxDC* DC, +void WinEDA_ViewlibFrame::GeneralControle( wxDC* DC, wxPoint MousePositionInPixels ) { - wxSize delta; - SCH_SCREEN* screen = GetScreen(); - wxPoint curpos, oldpos; - int hotkey = 0; + wxSize delta; + SCH_SCREEN* screen = GetScreen(); + wxPoint curpos, oldpos; + int hotkey = 0; ActiveScreen = screen; diff --git a/eeschema/dialog_SVG_print.cpp b/eeschema/dialog_SVG_print.cpp index d99693bb8f..8ffe8f376e 100644 --- a/eeschema/dialog_SVG_print.cpp +++ b/eeschema/dialog_SVG_print.cpp @@ -219,7 +219,7 @@ bool DIALOG_SVG_PRINT::DrawPage( const wxString& FullFileName, BASE_SCREEN* scre SheetSize.x *= m_Parent->m_InternalUnits / 1000; SheetSize.y *= m_Parent->m_InternalUnits / 1000; // size in pixels - screen->SetZoom( 1 ); + screen->SetScalingFactor( 1.0 ); dpi = (float) SheetSize.x * 25.4 / m_ImageXSize_mm; WinEDA_DrawPanel* panel = m_Parent->DrawPanel; diff --git a/eeschema/dialog_print_using_printer.cpp b/eeschema/dialog_print_using_printer.cpp index 17df758406..a89e934e5f 100644 --- a/eeschema/dialog_print_using_printer.cpp +++ b/eeschema/dialog_print_using_printer.cpp @@ -404,7 +404,7 @@ void EDA_Printout::DrawPage() double scaleX, scaleY, scale; wxPoint old_org; wxPoint DrawOffset; // Offset de trace - int DrawZoom = 1; + double DrawZoom = 1; wxDC* dc = GetDC(); wxBusyCursor dummy; @@ -416,7 +416,7 @@ void EDA_Printout::DrawPage() tmpzoom = ActiveScreen->GetZoom(); old_org = ActiveScreen->m_DrawOrg; /* Change draw scale and offset to draw the whole page */ - ActiveScreen->SetZoom( DrawZoom ); + ActiveScreen->SetScalingFactor( DrawZoom ); ActiveScreen->m_DrawOrg.x = ActiveScreen->m_DrawOrg.y = 0; ActiveScreen->m_StartVisu.x = ActiveScreen->m_StartVisu.y = 0; diff --git a/include/drawpanel_wxstruct.h b/include/drawpanel_wxstruct.h index b933913c2f..7c5b1196a5 100644 --- a/include/drawpanel_wxstruct.h +++ b/include/drawpanel_wxstruct.h @@ -115,7 +115,16 @@ public: bool OnRightClick( wxMouseEvent& event ); void OnPopupGridSelect( wxCommandEvent& event ); void Process_Special_Functions( wxCommandEvent& event ); + + /** Function CursorRealPosition + * @return the position in user units of location ScreenPos + * @param ScreenPos = the screen (in pixel) position co convert + */ wxPoint CursorRealPosition( const wxPoint& ScreenPos ); + + /** Function CursorScreenPosition + * @return the curseur current position in pixels in the screen draw area + */ wxPoint CursorScreenPosition(); /** @@ -303,6 +312,10 @@ public: wxSize ReturnPageSize( void ); virtual int GetInternalUnits( void ); + /** Function CursorRealPosition + * @return the position in user units of location ScreenPos + * @param ScreenPos = the screen (in pixel) position co convert + */ wxPoint CursorRealPosition( const wxPoint& ScreenPos ); /* general Undo/Redo command control */ @@ -326,9 +339,27 @@ public: //-------------------------------------------------------------- - /** - * Function GetZoom - * returns the current zoom factor + /** Function GetScalingFactor + * @return the the current scale used to draw items on screen + * draw coordinates are user coordinates * GetScalingFactor( ) + */ + double GetScalingFactor( ) + { + return (double) m_ZoomScalar / GetZoom(); + } + + /** Function SetScalingFactor + * @param the the current scale used to draw items on screen + * draw coordinates are user coordinates * GetScalingFactor( ) + */ + void SetScalingFactor(double aScale ) + { + SetZoom( (int) round(aScale * m_ZoomScalar) ); + } + /** Function GetZoom + * @return the current zoom factor + * Note: the zoom factor is NOT the scaling factor + * the scaling factor is m_ZoomScalar * GetZoom() */ int GetZoom() const; diff --git a/include/wxstruct.h b/include/wxstruct.h index 0ab337b783..6bfb6a5f74 100644 --- a/include/wxstruct.h +++ b/include/wxstruct.h @@ -286,7 +286,7 @@ public: */ wxString GetXYSheetReferences( BASE_SCREEN* aScreen, const wxPoint& aPosition ); - void DisplayToolMsg( const wxString msg ); + void DisplayToolMsg( const wxString& msg ); void Process_Zoom( wxCommandEvent& event ); void Process_Grid( wxCommandEvent& event ); virtual void RedrawActiveWindow( wxDC* DC, bool EraseBg ) = 0; diff --git a/pcbnew/basepcbframe.cpp b/pcbnew/basepcbframe.cpp index fbde86d8d0..48cf5e680a 100644 --- a/pcbnew/basepcbframe.cpp +++ b/pcbnew/basepcbframe.cpp @@ -363,6 +363,9 @@ void WinEDA_BasePcbFrame::SetToolID( int id, int new_cursor_id, } void WinEDA_BasePcbFrame::Affiche_Status_Box() +/* + * Update the status bar information. + */ { wxString Line; int dx, dy; diff --git a/pcbnew/dialog_SVG_print.cpp b/pcbnew/dialog_SVG_print.cpp index 8f0c89d55c..39a2be87f3 100644 --- a/pcbnew/dialog_SVG_print.cpp +++ b/pcbnew/dialog_SVG_print.cpp @@ -238,7 +238,7 @@ bool DIALOG_SVG_PRINT::DrawPage( const wxString& FullFileName, BASE_SCREEN* scre SheetSize.x *= m_Parent->m_InternalUnits / 1000; SheetSize.y *= m_Parent->m_InternalUnits / 1000; // size in pixels - screen->SetZoom( 1 ); + screen->SetScalingFactor( 1.0 ); dpi = (float) SheetSize.x * 25.4 / m_ImageXSize_mm; WinEDA_DrawPanel* panel = m_Parent->DrawPanel; diff --git a/pcbnew/dialog_print_using_printer.cpp b/pcbnew/dialog_print_using_printer.cpp index 18ef1d0fa8..5575a6ebd3 100644 --- a/pcbnew/dialog_print_using_printer.cpp +++ b/pcbnew/dialog_print_using_printer.cpp @@ -564,7 +564,7 @@ void EDA_Printout::DrawPage() wxPoint old_org; wxPoint DrawOffset; // Offset de trace double userscale; - int DrawZoom = 1; + double DrawZoom = 1; wxDC* dc = GetDC(); s_PrintMirror = m_PrintFrame->IsMirrored(); @@ -578,7 +578,7 @@ void EDA_Printout::DrawPage() tmpzoom = ActiveScreen->GetZoom(); old_org = ActiveScreen->m_DrawOrg; /* Change draw scale and offset to draw the whole page */ - ActiveScreen->SetZoom( DrawZoom ); + ActiveScreen->SetScalingFactor( DrawZoom ); ActiveScreen->m_DrawOrg.x = ActiveScreen->m_DrawOrg.y = 0; ActiveScreen->m_StartVisu.x = ActiveScreen->m_StartVisu.y = 0; diff --git a/pcbnew/tool_pcb.cpp b/pcbnew/tool_pcb.cpp index a3e23fb611..822c4fa8be 100644 --- a/pcbnew/tool_pcb.cpp +++ b/pcbnew/tool_pcb.cpp @@ -592,7 +592,14 @@ void WinEDA_PcbFrame::ReCreateAuxiliaryToolbar() for( int i = 0; i < (int)GetScreen()->m_ZoomList.GetCount(); i++ ) { msg = _( "Zoom " ); - msg << GetScreen()->m_ZoomList[i]; + if ( (GetScreen()->m_ZoomList[i] % GetScreen()->m_ZoomScalar) == 0 ) + msg << GetScreen()->m_ZoomList[i] / GetScreen()->m_ZoomScalar; + else + { + wxString value; + value.Printf(wxT("%.1f"),(float)GetScreen()->m_ZoomList[i] / GetScreen()->m_ZoomScalar ); + msg += value; + } m_SelZoomBox->Append( msg ); }