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
858401d2
Commit
858401d2
authored
Feb 25, 2011
by
jean-pierre charras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Eeschema & Pcbnew: fix incorrect position of cursor when crossprobing items.
parent
97003fef
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
26 deletions
+18
-26
find.cpp
eeschema/find.cpp
+15
-26
cross-probing.cpp
pcbnew/cross-probing.cpp
+3
-0
No files found.
eeschema/find.cpp
View file @
858401d2
...
@@ -105,10 +105,10 @@ SCH_ITEM* SCH_EDIT_FRAME::FindComponentAndItem( const wxString& component_refere
...
@@ -105,10 +105,10 @@ SCH_ITEM* SCH_EDIT_FRAME::FindComponentAndItem( const wxString& component_refere
const
wxString
&
text_to_find
,
const
wxString
&
text_to_find
,
bool
mouseWarp
)
bool
mouseWarp
)
{
{
SCH_SHEET_PATH
*
sheet
,
*
SheetWithComponentFound
=
NULL
;
SCH_SHEET_PATH
*
sheet
;
SCH_SHEET_PATH
*
sheetWithComponentFound
=
NULL
;
SCH_ITEM
*
DrawList
=
NULL
;
SCH_ITEM
*
DrawList
=
NULL
;
SCH_COMPONENT
*
Component
=
NULL
;
SCH_COMPONENT
*
Component
=
NULL
;
wxSize
DrawAreaSize
=
DrawPanel
->
GetClientSize
();
wxPoint
pos
,
curpos
;
wxPoint
pos
,
curpos
;
bool
DoCenterAndRedraw
=
false
;
bool
DoCenterAndRedraw
=
false
;
bool
NotFound
=
true
;
bool
NotFound
=
true
;
...
@@ -135,7 +135,7 @@ SCH_ITEM* SCH_EDIT_FRAME::FindComponentAndItem( const wxString& component_refere
...
@@ -135,7 +135,7 @@ SCH_ITEM* SCH_EDIT_FRAME::FindComponentAndItem( const wxString& component_refere
if
(
component_reference
.
CmpNoCase
(
pSch
->
GetRef
(
sheet
)
)
==
0
)
if
(
component_reference
.
CmpNoCase
(
pSch
->
GetRef
(
sheet
)
)
==
0
)
{
{
Component
=
pSch
;
Component
=
pSch
;
S
heetWithComponentFound
=
sheet
;
s
heetWithComponentFound
=
sheet
;
switch
(
SearchType
)
switch
(
SearchType
)
{
{
...
@@ -180,9 +180,8 @@ SCH_ITEM* SCH_EDIT_FRAME::FindComponentAndItem( const wxString& component_refere
...
@@ -180,9 +180,8 @@ SCH_ITEM* SCH_EDIT_FRAME::FindComponentAndItem( const wxString& component_refere
if
(
Component
)
if
(
Component
)
{
{
sheet
=
SheetWithComponentFound
;
sheet
=
sheetWithComponentFound
;
if
(
*
sheet
!=
*
GetSheet
()
)
if
(
sheet
!=
GetSheet
()
)
{
{
sheet
->
LastScreen
()
->
SetZoom
(
GetScreen
()
->
GetZoom
()
);
sheet
->
LastScreen
()
->
SetZoom
(
GetScreen
()
->
GetZoom
()
);
*
m_CurrentSheet
=
*
sheet
;
*
m_CurrentSheet
=
*
sheet
;
...
@@ -195,46 +194,36 @@ SCH_ITEM* SCH_EDIT_FRAME::FindComponentAndItem( const wxString& component_refere
...
@@ -195,46 +194,36 @@ SCH_ITEM* SCH_EDIT_FRAME::FindComponentAndItem( const wxString& component_refere
delta
=
Component
->
GetTransform
().
TransformCoordinate
(
pos
);
delta
=
Component
->
GetTransform
().
TransformCoordinate
(
pos
);
pos
=
delta
+
Component
->
m_Pos
;
pos
=
delta
+
Component
->
m_Pos
;
wxPoint
old_cursor_position
=
sheet
->
LastScreen
()
->
GetCrossHairPosition
();
sheet
->
LastScreen
()
->
SetCrossHairPosition
(
pos
);
curpos
=
GetScreen
()
->
GetCrossHairScreenPosition
();
DrawPanel
->
GetViewStart
(
&
(
GetScreen
()
->
m_StartVisu
.
x
),
&
(
GetScreen
()
->
m_StartVisu
.
y
)
);
// Calculating cursor position with original screen.
curpos
-=
GetScreen
()
->
m_StartVisu
;
/* There may be need to reframe the drawing */
/* There may be need to reframe the drawing */
#define MARGIN 30
if
(
!
DrawPanel
->
IsPointOnDisplay
(
pos
)
)
if
(
(
curpos
.
x
<=
MARGIN
)
||
(
curpos
.
x
>=
DrawAreaSize
.
x
-
MARGIN
)
||
(
curpos
.
y
<=
MARGIN
)
||
(
curpos
.
y
>=
DrawAreaSize
.
y
-
MARGIN
)
)
{
{
DoCenterAndRedraw
=
true
;
;
DoCenterAndRedraw
=
true
;
}
}
#undef MARGIN
if
(
DoCenterAndRedraw
)
if
(
DoCenterAndRedraw
)
RedrawScreen
(
curpos
,
mouseWarp
);
{
GetScreen
()
->
SetCrossHairPosition
(
pos
);
RedrawScreen
(
pos
,
mouseWarp
);
}
else
else
{
{
INSTALL_UNBUFFERED_DC
(
dc
,
DrawPanel
);
INSTALL_UNBUFFERED_DC
(
dc
,
DrawPanel
);
EXCHG
(
old_cursor_position
,
sheet
->
LastScreen
()
->
GetCrossHairPosition
()
);
DrawPanel
->
CrossHairOff
(
&
dc
);
DrawPanel
->
CrossHairOff
(
&
dc
);
if
(
mouseWarp
)
if
(
mouseWarp
)
DrawPanel
->
MoveCursor
(
cur
pos
);
DrawPanel
->
MoveCursor
(
pos
);
EXCHG
(
old_cursor_position
,
sheet
->
LastScreen
()
->
GetCrossHairPosition
()
);
GetScreen
()
->
SetCrossHairPosition
(
pos
);
DrawPanel
->
CrossHairOn
(
&
dc
);
DrawPanel
->
CrossHairOn
(
&
dc
);
}
}
}
}
/* Print dia
q
*/
/* Print dia
g
*/
wxString
msg_item
;
wxString
msg_item
;
msg
=
component_reference
;
msg
=
component_reference
;
...
...
pcbnew/cross-probing.cpp
View file @
858401d2
...
@@ -122,7 +122,10 @@ void RemoteCommand( const char* cmdline )
...
@@ -122,7 +122,10 @@ void RemoteCommand( const char* cmdline )
}
}
if
(
module
)
// if found, center the module on screen, and redraw the screen.
if
(
module
)
// if found, center the module on screen, and redraw the screen.
{
frame
->
GetScreen
()
->
SetCrossHairPosition
(
pos
);
frame
->
RedrawScreen
(
pos
,
false
);
frame
->
RedrawScreen
(
pos
,
false
);
}
}
}
...
...
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