Schematic: Add icons for Any/90/45 angle modes

Also add a dark mode icon for existing 45hv icon.

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/11332
This commit is contained in:
Mike Williams 2022-06-01 11:26:33 -04:00 committed by jean-pierre charras
parent 7ede2c70bd
commit 8d51b6b6d3
18 changed files with 310 additions and 61 deletions

View File

@ -329,6 +329,7 @@ set( BMAPS_MID
library_archive_as
library
library_table
lines_any
lines90
list_nets
load_drill

Binary file not shown.

After

Width:  |  Height:  |  Size: 236 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 276 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 378 B

View File

@ -0,0 +1,84 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
height="24"
width="24"
version="1.1"
id="svg2"
inkscape:version="1.1.1 (3bf5ae0d25, 2021-09-20)"
sodipodi:docname="hv45mode.svg"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/">
<metadata
id="metadata20">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs18" />
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1498"
inkscape:window-height="857"
id="namedview16"
showgrid="true"
inkscape:zoom="23.501099"
inkscape:cx="15.509913"
inkscape:cy="11.999439"
inkscape:window-x="519"
inkscape:window-y="90"
inkscape:window-maximized="0"
inkscape:current-layer="svg2"
inkscape:document-rotation="0"
inkscape:pagecheckerboard="0">
<inkscape:grid
type="xygrid"
id="grid2997"
empspacing="2"
visible="true"
enabled="true"
snapvisiblegridlinesonly="true"
spacingx="0.5"
spacingy="0.5" />
</sodipodi:namedview>
<path
style="fill:none;stroke:#e0e0e0;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;font-variation-settings:normal;opacity:1;vector-effect:none;fill-opacity:1;stroke-dashoffset:0;-inkscape-stroke:none;stop-color:#000000;stop-opacity:1"
d="m 4,12.5 h 7.5 V 20"
id="path3771"
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccc" />
<path
style="fill:#666666;stroke:#ded3dd;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;font-variation-settings:normal;opacity:1;vector-effect:none;fill-opacity:1;stroke-dashoffset:0;-inkscape-stroke:none;stop-color:#000000;stop-opacity:1"
d="M 4,2.0000001 V 22"
id="path2999"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cc" />
<path
inkscape:connector-curvature="0"
id="path3769"
d="M 22,20 H 2.0000001"
style="fill:#666666;stroke:#ded3dd;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;font-variation-settings:normal;opacity:1;vector-effect:none;fill-opacity:1;stroke-dashoffset:0;-inkscape-stroke:none;stop-color:#000000;stop-opacity:1"
sodipodi:nodetypes="cc" />
<path
style="fill:#666666;stroke:#ded3dd;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;font-variation-settings:normal;opacity:1;vector-effect:none;fill-opacity:1;stroke-dashoffset:0;-inkscape-stroke:none;stop-color:#000000;stop-opacity:1"
d="M 4.0000044,20.000002 18.5,5.5"
id="path841"
sodipodi:nodetypes="cc" />
</svg>

After

Width:  |  Height:  |  Size: 3.4 KiB

View File

@ -0,0 +1,88 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
height="24"
width="24"
version="1.1"
id="svg2"
inkscape:version="1.1.1 (3bf5ae0d25, 2021-09-20)"
sodipodi:docname="lines_any.svg"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/">
<metadata
id="metadata20">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs18" />
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1920"
inkscape:window-height="987"
id="namedview16"
showgrid="true"
inkscape:zoom="33.235573"
inkscape:cx="11.027341"
inkscape:cy="10.891944"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:current-layer="svg2"
inkscape:document-rotation="0"
inkscape:pagecheckerboard="0">
<inkscape:grid
type="xygrid"
id="grid2997"
empspacing="2"
visible="true"
enabled="true"
snapvisiblegridlinesonly="true"
spacingx="0.5"
spacingy="0.5" />
</sodipodi:namedview>
<path
style="fill:#666666;stroke:#DED3DD;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="M 4,2.0000001 V 22"
id="path2999"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cc" />
<path
inkscape:connector-curvature="0"
id="path3769"
d="M 22,20 H 2.0000001"
style="fill:#666666;stroke:#DED3DD;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
sodipodi:nodetypes="cc" />
<path
style="fill:#666666;stroke:#ded3dd;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;font-variation-settings:normal;opacity:1;fill-opacity:1;stroke-dashoffset:0;stop-color:#000000;stop-opacity:1"
d="M 10.5,5.5 4.0000038,20.000002"
id="path841"
sodipodi:nodetypes="cc" />
<path
style="fill:#666666;stroke:#ded3dd;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;font-variation-settings:normal;opacity:1;fill-opacity:1;stroke-dashoffset:0;stop-color:#000000;stop-opacity:1"
d="M 15.5,14.500001 10.5,5.5"
id="path2947"
sodipodi:nodetypes="cc" />
<path
style="fill:#666666;stroke:#ded3dd;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;font-variation-settings:normal;opacity:1;fill-opacity:1;stroke-dashoffset:0;stop-color:#000000;stop-opacity:1"
d="m 20.5,10 -5,4.5"
id="path2949"
sodipodi:nodetypes="cc" />
</svg>

After

Width:  |  Height:  |  Size: 3.3 KiB

View File

@ -0,0 +1,88 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
height="24"
width="24"
version="1.1"
id="svg2"
inkscape:version="1.1.1 (3bf5ae0d25, 2021-09-20)"
sodipodi:docname="lines_any.svg"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/">
<metadata
id="metadata20">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs18" />
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1920"
inkscape:window-height="1049"
id="namedview16"
showgrid="true"
inkscape:zoom="20.456599"
inkscape:cx="-4.2773483"
inkscape:cy="11.389968"
inkscape:window-x="1920"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:current-layer="svg2"
inkscape:document-rotation="0"
inkscape:pagecheckerboard="0">
<inkscape:grid
type="xygrid"
id="grid2997"
empspacing="2"
visible="true"
enabled="true"
snapvisiblegridlinesonly="true"
spacingx="0.5"
spacingy="0.5" />
</sodipodi:namedview>
<path
style="fill:#666666;stroke:#545454;stroke-width:1.99937008;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="M 4,2.0000001 V 22"
id="path2999"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cc" />
<path
inkscape:connector-curvature="0"
id="path3769"
d="M 22,20 H 2.0000001"
style="fill:#666666;stroke:#545454;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
sodipodi:nodetypes="cc" />
<path
style="fill:none;stroke:#545454;stroke-width:0.999997;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="M 10.5,5.4999998 4.0000038,20.000002"
id="path841"
sodipodi:nodetypes="cc" />
<path
style="fill:none;stroke:#545454;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="M 15.5,14.500001 10.5,5.5"
id="path2947"
sodipodi:nodetypes="cc" />
<path
style="fill:none;stroke:#545454;stroke-width:0.999997;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 20.5,10 -5,4.5"
id="path2949"
sodipodi:nodetypes="cc" />
</svg>

After

Width:  |  Height:  |  Size: 3.0 KiB

View File

@ -35,7 +35,6 @@ enum LINE_MODE
LINE_MODE_FREE = 0,
LINE_MODE_90 = 1,
LINE_MODE_45 = 2,
LINE_MODE_135 = 3,
LINE_MODE_COUNT,
};

View File

@ -441,7 +441,6 @@ void SCH_EDIT_FRAME::setupUIConditions()
mgr->SetConditions( EE_ACTIONS::lineModeFree, CHECK( cond.LineMode( LINE_MODE::LINE_MODE_FREE ) ) );
mgr->SetConditions( EE_ACTIONS::lineMode90, CHECK( cond.LineMode( LINE_MODE::LINE_MODE_90 ) ) );
mgr->SetConditions( EE_ACTIONS::lineMode45, CHECK( cond.LineMode( LINE_MODE::LINE_MODE_45 ) ) );
mgr->SetConditions( EE_ACTIONS::lineMode135, CHECK( cond.LineMode( LINE_MODE::LINE_MODE_135 ) ) );
mgr->SetConditions( ACTIONS::cut, ENABLE( hasElements ) );
mgr->SetConditions( ACTIONS::copy, ENABLE( hasElements ) );

View File

@ -205,7 +205,6 @@ void SCH_EDIT_FRAME::ReCreateOptToolbar()
m_optionsToolBar->Add( EE_ACTIONS::lineModeFree, ACTION_TOOLBAR::TOGGLE );
m_optionsToolBar->Add( EE_ACTIONS::lineMode90, ACTION_TOOLBAR::TOGGLE );
m_optionsToolBar->Add( EE_ACTIONS::lineMode45, ACTION_TOOLBAR::TOGGLE );
m_optionsToolBar->Add( EE_ACTIONS::lineMode135, ACTION_TOOLBAR::TOGGLE );
m_optionsToolBar->AddScaledSeparator( this );
m_optionsToolBar->Add( EE_ACTIONS::toggleAnnotateAuto, ACTION_TOOLBAR::TOGGLE );

View File

@ -687,7 +687,7 @@ TOOL_ACTION EE_ACTIONS::toggleERCExclusions( "eeschema.EditorControl.showERCExcl
TOOL_ACTION EE_ACTIONS::lineModeFree( "eeschema.EditorControl.lineModeFree",
AS_GLOBAL, 0, "",
_( "Line Mode for Wires and Buses" ), _( "Lines drawn at any angle" ),
BITMAPS::unknown, AF_NONE, (void*) LINE_MODE::LINE_MODE_FREE );
BITMAPS::lines_any, AF_NONE, (void*) LINE_MODE::LINE_MODE_FREE );
TOOL_ACTION EE_ACTIONS::lineMode90( "eeschema.EditorControl.lineModeOrthonal",
AS_GLOBAL, 0, "",
@ -696,13 +696,8 @@ TOOL_ACTION EE_ACTIONS::lineMode90( "eeschema.EditorControl.lineModeOrthonal",
TOOL_ACTION EE_ACTIONS::lineMode45( "eeschema.EditorControl.lineMode45",
AS_GLOBAL, 0, "",
_( "Line Mode for Wires and Buses" ), _( "Lines drawn horizontally and vertically, with a 45 degree angle end" ),
BITMAPS::unknown, AF_NONE, (void*) LINE_MODE::LINE_MODE_45);
TOOL_ACTION EE_ACTIONS::lineMode135( "eeschema.EditorControl.lineMode135",
AS_GLOBAL, 0, "",
_( "Line Mode for Wires and Buses" ), _( "Lines drawn horizontally and vertically, with a 45 degree angle start" ),
BITMAPS::unknown, AF_NONE, (void*) LINE_MODE::LINE_MODE_135);
_( "Line Mode for Wires and Buses" ), _( "Lines drawn horizontally, vertically, and at a 45 degree angle" ),
BITMAPS::hv45mode, AF_NONE, (void*) LINE_MODE::LINE_MODE_45);
TOOL_ACTION EE_ACTIONS::lineModeNext( "eeschema.EditorControl.lineModeNext",
AS_GLOBAL, MD_SHIFT + WXK_SPACE, "",

View File

@ -230,7 +230,6 @@ public:
static TOOL_ACTION lineModeFree;
static TOOL_ACTION lineMode90;
static TOOL_ACTION lineMode45;
static TOOL_ACTION lineMode135;
static TOOL_ACTION lineModeNext;
// Annotation

View File

@ -2190,21 +2190,6 @@ int SCH_EDITOR_CONTROL::NextLineMode( const TOOL_EVENT& aEvent )
}
int SCH_EDITOR_CONTROL::SwitchSegmentPosture( const TOOL_EVENT& aEvent )
{
// The 45/135 angle modes are the only ones with fixed postures, so
// only toggle them if we're already in one of these modes
if (m_frame->eeconfig()->m_Drawing.line_mode == LINE_MODE::LINE_MODE_45)
m_frame->eeconfig()->m_Drawing.line_mode = LINE_MODE::LINE_MODE_135;
else if (m_frame->eeconfig()->m_Drawing.line_mode == LINE_MODE::LINE_MODE_135)
m_frame->eeconfig()->m_Drawing.line_mode = LINE_MODE::LINE_MODE_45;
m_toolMgr->RunAction( ACTIONS::refreshPreview );
return 0;
}
int SCH_EDITOR_CONTROL::ToggleAnnotateAuto( const TOOL_EVENT& aEvent )
{
EESCHEMA_SETTINGS* cfg = m_frame->eeconfig();
@ -2394,9 +2379,7 @@ void SCH_EDITOR_CONTROL::setTransitions()
Go( &SCH_EDITOR_CONTROL::ChangeLineMode, EE_ACTIONS::lineModeFree.MakeEvent() );
Go( &SCH_EDITOR_CONTROL::ChangeLineMode, EE_ACTIONS::lineMode90.MakeEvent() );
Go( &SCH_EDITOR_CONTROL::ChangeLineMode, EE_ACTIONS::lineMode45.MakeEvent() );
Go( &SCH_EDITOR_CONTROL::ChangeLineMode, EE_ACTIONS::lineMode135.MakeEvent() );
Go( &SCH_EDITOR_CONTROL::NextLineMode, EE_ACTIONS::lineModeNext.MakeEvent() );
Go( &SCH_EDITOR_CONTROL::SwitchSegmentPosture, EE_ACTIONS::switchSegmentPosture.MakeEvent() );
Go( &SCH_EDITOR_CONTROL::ToggleAnnotateAuto, EE_ACTIONS::toggleAnnotateAuto.MakeEvent() );
Go( &SCH_EDITOR_CONTROL::TogglePythonConsole, EE_ACTIONS::showPythonConsole.MakeEvent() );

View File

@ -141,7 +141,6 @@ public:
int ToggleERCExclusions( const TOOL_EVENT& aEvent );
int ChangeLineMode( const TOOL_EVENT& aEvent );
int NextLineMode( const TOOL_EVENT& aEvent );
int SwitchSegmentPosture( const TOOL_EVENT& aEvent );
int ToggleAnnotateAuto( const TOOL_EVENT& aEvent );
int ToggleAnnotateRecursive( const TOOL_EVENT& aEvent );
int TogglePythonConsole( const TOOL_EVENT& aEvent );

View File

@ -425,7 +425,8 @@ const SCH_SHEET_PIN* SCH_LINE_WIRE_BUS_TOOL::getSheetPin( const VECTOR2I& aPosit
void SCH_LINE_WIRE_BUS_TOOL::computeBreakPoint( const std::pair<SCH_LINE*, SCH_LINE*>& aSegments,
VECTOR2I& aPosition,
LINE_MODE mode )
LINE_MODE mode,
bool posture )
{
wxCHECK_RET( aSegments.first && aSegments.second,
wxT( "Cannot compute break point of NULL line segment." ) );
@ -442,7 +443,7 @@ void SCH_LINE_WIRE_BUS_TOOL::computeBreakPoint( const std::pair<SCH_LINE*, SCH_L
bool preferHorizontal;
bool preferVertical;
if( mode == LINE_MODE_135 )
if( ( mode == LINE_MODE_45 ) && posture )
{
preferHorizontal = ( nextSegment->GetEndPoint().x - nextSegment->GetStartPoint().x ) != 0;
preferVertical = ( nextSegment->GetEndPoint().y - nextSegment->GetStartPoint().y ) != 0;
@ -475,12 +476,16 @@ void SCH_LINE_WIRE_BUS_TOOL::computeBreakPoint( const std::pair<SCH_LINE*, SCH_L
switch( mode )
{
case LINE_MODE_45:
if( !posture )
{
midPoint.x = segment->GetStartPoint().x;
midPoint.y = aPosition.y - yDir * abs( delta.x );
break;
case LINE_MODE_135:
}
else
{
midPoint.x = aPosition.x;
midPoint.y = segment->GetStartPoint().y + yDir * abs( delta.x );
}
break;
default:
midPoint.x = segment->GetStartPoint().x;
@ -494,12 +499,16 @@ void SCH_LINE_WIRE_BUS_TOOL::computeBreakPoint( const std::pair<SCH_LINE*, SCH_L
switch( mode )
{
case LINE_MODE_45:
if( !posture )
{
midPoint.x = aPosition.x - xDir * abs( delta.y );
midPoint.y = segment->GetStartPoint().y;
break;
case LINE_MODE_135:
}
else
{
midPoint.x = segment->GetStartPoint().x + xDir * abs( delta.y );
midPoint.y = aPosition.y;
}
break;
default:
midPoint.x = aPosition.x;
@ -522,14 +531,14 @@ void SCH_LINE_WIRE_BUS_TOOL::computeBreakPoint( const std::pair<SCH_LINE*, SCH_L
// /__________
VECTOR2I deltaMidpoint = midPoint - segment->GetStartPoint();
if( mode == LINE_MODE::LINE_MODE_45
if( mode == LINE_MODE::LINE_MODE_45 && !posture
&& ( ( alg::signbit( deltaMidpoint.x ) != alg::signbit( delta.x ) )
|| ( alg::signbit( deltaMidpoint.y ) != alg::signbit( delta.y ) ) ) )
{
preferVertical = false;
preferHorizontal = false;
}
else if( mode == LINE_MODE::LINE_MODE_135
else if( mode == LINE_MODE::LINE_MODE_45 && posture
&& ( ( abs( deltaMidpoint.x ) > abs( delta.x ) )
|| ( abs( deltaMidpoint.y ) > abs( delta.y ) ) ) )
{
@ -558,6 +567,7 @@ int SCH_LINE_WIRE_BUS_TOOL::doDrawSegments( const std::string& aTool, int aType,
EE_GRID_HELPER grid( m_toolMgr );
KIGFX::VIEW_CONTROLS* controls = getViewControls();
int lastMode = m_frame->eeconfig()->m_Drawing.line_mode;
static bool posture = false;
auto setCursor =
[&]()
@ -774,11 +784,8 @@ int SCH_LINE_WIRE_BUS_TOOL::doDrawSegments( const std::string& aTool, int aType,
// When placing lines with the forty-five degree end, the user is
// targetting the endpoint with the angled portion, so it's more
// intuitive to place both segments at the same time.
if( currentMode == LINE_MODE::LINE_MODE_45
|| currentMode == LINE_MODE::LINE_MODE_135 )
{
if( currentMode == LINE_MODE::LINE_MODE_45 )
placedSegments++;
}
segment->SetEndPoint( cursorPos );
@ -799,7 +806,7 @@ int SCH_LINE_WIRE_BUS_TOOL::doDrawSegments( const std::string& aTool, int aType,
{
if( twoSegments && m_wires.size() >= 2 )
computeBreakPoint( { m_wires[m_wires.size() - 2], segment }, cursorPos,
currentMode );
currentMode, posture );
finishSegments();
segment = nullptr;
@ -860,7 +867,7 @@ int SCH_LINE_WIRE_BUS_TOOL::doDrawSegments( const std::string& aTool, int aType,
if( twoSegments && m_wires.size() >= 2 )
{
computeBreakPoint( { m_wires[m_wires.size() - 2], segment }, cursorPos,
currentMode );
currentMode, posture );
}
else
{
@ -892,7 +899,7 @@ int SCH_LINE_WIRE_BUS_TOOL::doDrawSegments( const std::string& aTool, int aType,
if( twoSegments && m_wires.size() >= 2 )
{
computeBreakPoint( { m_wires[m_wires.size() - 2], segment }, cursorPos,
currentMode );
currentMode, posture );
}
else
{
@ -910,12 +917,14 @@ int SCH_LINE_WIRE_BUS_TOOL::doDrawSegments( const std::string& aTool, int aType,
wxBell();
}
}
else if( evt->IsAction( &EE_ACTIONS::switchSegmentPosture ) )
else if( evt->IsAction( &EE_ACTIONS::switchSegmentPosture ) && m_wires.size() >= 2 )
{
posture = !posture;
// The 90 degree mode doesn't have a forced posture like
// the 45 and 135 degree modes, so we don't have a mode to toggle
// in the UI. Instead, just swap the 90 angle here.
if( currentMode == LINE_MODE::LINE_MODE_90 && m_wires.size() >= 2 )
// the 45 degree mode and computeBreakPoint maintains existing 90s' postures.
// Instead, just swap the 90 angle here.
if( currentMode == LINE_MODE::LINE_MODE_90 )
{
m_view->ClearPreview();
@ -936,9 +945,10 @@ int SCH_LINE_WIRE_BUS_TOOL::doDrawSegments( const std::string& aTool, int aType,
}
else
{
// Posture change for 45/135 will come back around as a mode
// change and we'll refresh as needed
evt->SetPassEvent();
computeBreakPoint( { m_wires[m_wires.size() - 2], segment }, cursorPos, currentMode,
posture );
m_toolMgr->RunAction( ACTIONS::refreshPreview );
}
}
//------------------------------------------------------------------------

View File

@ -131,9 +131,10 @@ private:
* @param aPosition A reference to a wxPoint object containing the coordinates of the
* position used to calculate the line break point.
* @param mode LINE_MODE specifying the way to break the line
* @param posture Toggles the posture of the line
*/
void computeBreakPoint( const std::pair<SCH_LINE*, SCH_LINE*>& aSegments, VECTOR2I& aPosition,
LINE_MODE mode );
LINE_MODE mode, bool posture );
private:
bool m_inDrawingTool; // Reentrancy guard

View File

@ -365,6 +365,7 @@ const std::vector<BITMAP_INFO> g_BitmapInfo = {
{ BITMAPS::library_archive_as, wxT( "library_archive_as_24.png" ), 24, wxT( "light" ) },
{ BITMAPS::library, wxT( "library_24.png" ), 24, wxT( "light" ) },
{ BITMAPS::library_table, wxT( "library_table_24.png" ), 24, wxT( "light" ) },
{ BITMAPS::lines_any, wxT( "lines_any_24.png" ), 24, wxT( "light" ) },
{ BITMAPS::lines90, wxT( "lines90_24.png" ), 24, wxT( "light" ) },
{ BITMAPS::list_nets, wxT( "list_nets_24.png" ), 24, wxT( "light" ) },
{ BITMAPS::load_drill, wxT( "load_drill_24.png" ), 24, wxT( "light" ) },
@ -705,6 +706,7 @@ const std::vector<BITMAP_INFO> g_BitmapInfo = {
{ BITMAPS::hotkeys, wxT( "hotkeys_dark_24.png" ), 24, wxT( "dark" ) },
{ BITMAPS::hole_to_hole_clearance, wxT( "hole_to_hole_clearance_dark_24.png" ), 24, wxT( "dark" ) },
{ BITMAPS::hole_to_copper_clearance, wxT( "hole_to_copper_clearance_dark_24.png" ), 24, wxT( "dark" ) },
{ BITMAPS::hv45mode, wxT( "hv45mode_dark_24.png" ), 24, wxT( "dark" ) },
{ BITMAPS::icon_cvpcb_24, wxT( "icon_cvpcb_24_dark_24.png" ), 24, wxT( "dark" ) },
{ BITMAPS::icon_footprint_browser, wxT( "icon_footprint_browser_dark_24.png" ), 24, wxT( "dark" ) },
{ BITMAPS::icon_gerbview_24, wxT( "icon_gerbview_24_dark_24.png" ), 24, wxT( "dark" ) },
@ -734,6 +736,7 @@ const std::vector<BITMAP_INFO> g_BitmapInfo = {
{ BITMAPS::library_archive_as, wxT( "library_archive_as_dark_24.png" ), 24, wxT( "dark" ) },
{ BITMAPS::library, wxT( "library_dark_24.png" ), 24, wxT( "dark" ) },
{ BITMAPS::library_table, wxT( "library_table_dark_24.png" ), 24, wxT( "dark" ) },
{ BITMAPS::lines_any, wxT( "lines_any_dark_24.png" ), 24, wxT( "dark" ) },
{ BITMAPS::lines90, wxT( "lines90_dark_24.png" ), 24, wxT( "dark" ) },
{ BITMAPS::list_nets, wxT( "list_nets_dark_24.png" ), 24, wxT( "dark" ) },
{ BITMAPS::load_drill, wxT( "load_drill_dark_24.png" ), 24, wxT( "dark" ) },

View File

@ -307,6 +307,7 @@ enum class BITMAPS : unsigned int
library_archive_as,
library_browser,
library_table,
lines_any,
lines90,
list_nets,
list_nets_16,