Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
kicad-source-mirror
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
kicad-source-mirror
Commits
3ea0c106
Commit
3ea0c106
authored
Jun 16, 2011
by
jean-pierre charras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Eeschema: fix a bug I created in commit 3018
parent
a0e0ad6f
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
26 additions
and
15 deletions
+26
-15
edit_label.cpp
eeschema/edit_label.cpp
+2
-0
sch_text.cpp
eeschema/sch_text.cpp
+2
-0
schframe.cpp
eeschema/schframe.cpp
+7
-2
sheet.cpp
eeschema/sheet.cpp
+2
-0
editrack.cpp
pcbnew/editrack.cpp
+13
-13
No files found.
eeschema/edit_label.cpp
View file @
3ea0c106
...
...
@@ -73,7 +73,9 @@ static void abortMoveText( EDA_DRAW_PANEL* aPanel, wxDC* aDC )
wxCHECK_RET
(
item
!=
NULL
,
wxT
(
"Cannot restore undefined last text item."
)
);
screen
->
AddToDrawList
(
item
);
// the owner of item is no more parent, this is the draw list of screen:
parent
->
SetUndoItem
(
NULL
);
item
->
Draw
(
aPanel
,
aDC
,
wxPoint
(
0
,
0
),
GR_DEFAULT_DRAWMODE
);
item
->
ClearFlags
();
}
...
...
eeschema/sch_text.cpp
View file @
3ea0c106
...
...
@@ -337,7 +337,9 @@ void SCH_TEXT::Place( SCH_EDIT_FRAME* frame, wxDC* DC )
undoItem
->
ClearFlags
();
picker
.
SetLink
(
undoItem
);
// the owner of undoItem is no more frame, this is picker:
frame
->
SetUndoItem
(
NULL
);
pickList
.
PushItem
(
picker
);
frame
->
SaveCopyInUndoList
(
pickList
,
UR_EXCHANGE_T
);
}
...
...
eeschema/schframe.cpp
View file @
3ea0c106
...
...
@@ -352,15 +352,20 @@ void SCH_EDIT_FRAME::CreateScreens()
void
SCH_EDIT_FRAME
::
SetUndoItem
(
const
SCH_ITEM
*
aItem
)
{
if
(
m_undoItem
!=
NULL
)
// if aItem != NULL, delete a previous m_undoItem, if exists
// if aItme = NULL, just clear m_undoItem,
// because when calling SetUndoItem( NULL ), we only clear m_undoItem,
// because the owner of m_undoItem is no more me.
if
(
aItem
&&
m_undoItem
)
{
delete
m_undoItem
;
m_undoItem
=
NULL
;
}
m_undoItem
=
NULL
;
if
(
aItem
)
m_undoItem
=
aItem
->
Clone
();
}
...
...
eeschema/sheet.cpp
View file @
3ea0c106
...
...
@@ -261,7 +261,9 @@ static void ExitSheet( EDA_DRAW_PANEL* aPanel, wxDC* aDC )
wxCHECK_RET
(
item
!=
NULL
,
wxT
(
"Cannot restore undefined last sheet item."
)
);
screen
->
AddToDrawList
(
item
);
// the owner of item is no more parent, this is the draw list of screen:
parent
->
SetUndoItem
(
NULL
);
item
->
Draw
(
aPanel
,
aDC
,
wxPoint
(
0
,
0
),
GR_DEFAULT_DRAWMODE
);
item
->
ClearFlags
();
SCH_SHEET
*
sheet
=
(
SCH_SHEET
*
)
item
;
...
...
pcbnew/editrack.cpp
View file @
3ea0c106
...
...
@@ -310,9 +310,9 @@ bool PCB_EDIT_FRAME::Add_45_degrees_Segment( wxDC* DC )
return
false
;
}
int
pas
_45
=
wxRound
(
GetScreen
()
->
GetGridSize
().
x
/
2
);
if
(
pas_45
<
curTrack
->
m_Width
)
pas_45
=
curTrack
->
m_Width
;
int
segm_step
_45
=
wxRound
(
GetScreen
()
->
GetGridSize
().
x
/
2
);
if
(
segm_step_45
<
(
curTrack
->
m_Width
*
2
)
)
segm_step_45
=
curTrack
->
m_Width
*
2
;
// Test if the segments are horizontal or vertical.
dx0
=
prevTrack
->
m_End
.
x
-
prevTrack
->
m_Start
.
x
;
...
...
@@ -322,10 +322,10 @@ bool PCB_EDIT_FRAME::Add_45_degrees_Segment( wxDC* DC )
dy1
=
curTrack
->
m_End
.
y
-
curTrack
->
m_Start
.
y
;
// Segments must be of sufficient length.
if
(
MAX
(
abs
(
dx0
),
abs
(
dy0
)
)
<
(
pas
_45
*
2
)
)
if
(
MAX
(
abs
(
dx0
),
abs
(
dy0
)
)
<
(
segm_step
_45
*
2
)
)
return
false
;
if
(
MAX
(
abs
(
dx1
),
abs
(
dy1
)
)
<
(
pas
_45
*
2
)
)
if
(
MAX
(
abs
(
dx1
),
abs
(
dy1
)
)
<
(
segm_step
_45
*
2
)
)
return
false
;
/* Create a new segment and connect it with the previous 2 segments. */
...
...
@@ -347,14 +347,14 @@ bool PCB_EDIT_FRAME::Add_45_degrees_Segment( wxDC* DC )
* horizontal segment.
*/
if
(
dy0
>
0
)
newTrack
->
m_Start
.
y
-=
pas
_45
;
newTrack
->
m_Start
.
y
-=
segm_step
_45
;
else
newTrack
->
m_Start
.
y
+=
pas
_45
;
newTrack
->
m_Start
.
y
+=
segm_step
_45
;
if
(
dx1
>
0
)
newTrack
->
m_End
.
x
+=
pas
_45
;
newTrack
->
m_End
.
x
+=
segm_step
_45
;
else
newTrack
->
m_End
.
x
-=
pas
_45
;
newTrack
->
m_End
.
x
-=
segm_step
_45
;
if
(
Drc_On
&&
BAD_DRC
==
m_drc
->
Drc
(
curTrack
,
GetBoard
()
->
m_Track
)
)
{
...
...
@@ -382,14 +382,14 @@ bool PCB_EDIT_FRAME::Add_45_degrees_Segment( wxDC* DC )
* (horizontal) and segment 2 (vertical)
*/
if
(
dx0
>
0
)
newTrack
->
m_Start
.
x
-=
pas
_45
;
newTrack
->
m_Start
.
x
-=
segm_step
_45
;
else
newTrack
->
m_Start
.
x
+=
pas
_45
;
newTrack
->
m_Start
.
x
+=
segm_step
_45
;
if
(
dy1
>
0
)
newTrack
->
m_End
.
y
+=
pas
_45
;
newTrack
->
m_End
.
y
+=
segm_step
_45
;
else
newTrack
->
m_End
.
y
-=
pas
_45
;
newTrack
->
m_End
.
y
-=
segm_step
_45
;
if
(
Drc_On
&&
BAD_DRC
==
m_drc
->
Drc
(
newTrack
,
GetBoard
()
->
m_Track
)
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment