Commit e6598e9d authored by Maciej Suminski's avatar Maciej Suminski
Browse files

Added VIEW::ToWorld( double ).

TOOL_EVENT message is supposed to contain string as parameter.
Added missing header for class_drawsegment.h (KiROUND).
Renamed SELECTION_TOOL::containsSelected() to SELECTION_TOOL::selectionContains().
parent a42a83a3
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -204,6 +204,14 @@ VECTOR2D VIEW::ToWorld( const VECTOR2D& aCoord, bool aAbsolute ) const
}


double VIEW::ToWorld( double aSize ) const
{
    const MATRIX3x3D& matrix = m_gal->GetScreenWorldMatrix();

    return matrix.GetScale().x * aSize;
}


VECTOR2D VIEW::ToScreen( const VECTOR2D& aCoord, bool aAbsolute ) const
{
    const MATRIX3x3D& matrix = m_gal->GetWorldScreenMatrix();
+2 −2
Original line number Diff line number Diff line
@@ -189,7 +189,7 @@ public:
        m_scope( aScope ),
        m_mouseButtons( 0 )
    {
        if( aCategory == TC_COMMAND )
        if( aCategory == TC_COMMAND || aCategory == TC_MESSAGE )
            m_commandStr = aExtraParam;
    }

@@ -317,7 +317,7 @@ public:
        if( !( m_actions & aEvent.m_actions ) )
            return false;

        if( m_category == TC_COMMAND )
        if( m_category == TC_COMMAND || m_category == TC_MESSAGE )
        {
            if( m_commandStr && aEvent.m_commandStr )
                return *m_commandStr == *aEvent.m_commandStr;
+8 −0
Original line number Diff line number Diff line
@@ -232,6 +232,14 @@ public:
     */
    VECTOR2D ToWorld( const VECTOR2D& aCoord, bool aAbsolute = true ) const;

    /**
     * Function ToWorld()
     * Converts a screen space one dimensional size to a one dimensional size in world
     * space coordinates.
     * @param aCoord: the size to be converted
     */
    double ToWorld( double aSize ) const;

    /**
     * Function ToScreen()
     * Converts a world space point/vector to a point/vector in screen space coordinates.
+1 −0
Original line number Diff line number Diff line
@@ -34,6 +34,7 @@
#include <PolyLine.h>
#include <math_for_graphics.h>
#include <trigo.h>
#include <common.h>


class LINE_READER;
+1 −1
Original line number Diff line number Diff line
@@ -101,7 +101,7 @@ private:
    ///> Removes and frees a single BOARD_ITEM.
    void remove( BOARD_ITEM* aItem );

    ///> Sets up handlers for various events
    ///> Sets up handlers for various events.
    void setTransitions();

    ///> The required update flag for modified items
Loading