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
d583280b
Commit
d583280b
authored
Feb 24, 2014
by
Maciej Suminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor code cleaning and optimizations.
parent
de637d2b
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
23 deletions
+13
-23
view.cpp
common/view/view.cpp
+10
-14
pcbframe.cpp
pcbnew/pcbframe.cpp
+3
-9
No files found.
common/view/view.cpp
View file @
d583280b
...
@@ -127,11 +127,10 @@ void VIEW::Remove( VIEW_ITEM* aItem )
...
@@ -127,11 +127,10 @@ void VIEW::Remove( VIEW_ITEM* aItem )
int
prevGroup
=
aItem
->
getGroup
(
layers
[
i
]
);
int
prevGroup
=
aItem
->
getGroup
(
layers
[
i
]
);
if
(
prevGroup
>=
0
)
if
(
prevGroup
>=
0
)
{
m_gal
->
DeleteGroup
(
prevGroup
);
m_gal
->
DeleteGroup
(
prevGroup
);
aItem
->
setGroup
(
layers
[
i
],
-
1
);
}
}
}
aItem
->
deleteGroups
();
}
}
...
@@ -199,13 +198,9 @@ VECTOR2D VIEW::ToWorld( const VECTOR2D& aCoord, bool aAbsolute ) const
...
@@ -199,13 +198,9 @@ VECTOR2D VIEW::ToWorld( const VECTOR2D& aCoord, bool aAbsolute ) const
const
MATRIX3x3D
&
matrix
=
m_gal
->
GetScreenWorldMatrix
();
const
MATRIX3x3D
&
matrix
=
m_gal
->
GetScreenWorldMatrix
();
if
(
aAbsolute
)
if
(
aAbsolute
)
{
return
VECTOR2D
(
matrix
*
aCoord
);
return
VECTOR2D
(
matrix
*
aCoord
);
}
else
else
{
return
VECTOR2D
(
matrix
.
GetScale
().
x
*
aCoord
.
x
,
matrix
.
GetScale
().
y
*
aCoord
.
y
);
return
VECTOR2D
(
matrix
.
GetScale
().
x
*
aCoord
.
x
,
matrix
.
GetScale
().
y
*
aCoord
.
y
);
}
}
}
...
@@ -214,13 +209,9 @@ VECTOR2D VIEW::ToScreen( const VECTOR2D& aCoord, bool aAbsolute ) const
...
@@ -214,13 +209,9 @@ VECTOR2D VIEW::ToScreen( const VECTOR2D& aCoord, bool aAbsolute ) const
const
MATRIX3x3D
&
matrix
=
m_gal
->
GetWorldScreenMatrix
();
const
MATRIX3x3D
&
matrix
=
m_gal
->
GetWorldScreenMatrix
();
if
(
aAbsolute
)
if
(
aAbsolute
)
{
return
VECTOR2D
(
matrix
*
aCoord
);
return
VECTOR2D
(
matrix
*
aCoord
);
}
else
else
{
return
VECTOR2D
(
matrix
.
GetScale
().
x
*
aCoord
.
x
,
matrix
.
GetScale
().
y
*
aCoord
.
y
);
return
VECTOR2D
(
matrix
.
GetScale
().
x
*
aCoord
.
x
,
matrix
.
GetScale
().
y
*
aCoord
.
y
);
}
}
}
...
@@ -699,6 +690,7 @@ struct VIEW::recacheItem
...
@@ -699,6 +690,7 @@ struct VIEW::recacheItem
}
}
else
else
{
{
aItem
->
ViewUpdate
(
VIEW_ITEM
::
ALL
);
aItem
->
setGroup
(
layer
,
-
1
);
aItem
->
setGroup
(
layer
,
-
1
);
}
}
...
@@ -730,6 +722,7 @@ void VIEW::Clear()
...
@@ -730,6 +722,7 @@ void VIEW::Clear()
}
}
m_gal
->
ClearCache
();
m_gal
->
ClearCache
();
m_needsUpdate
.
clear
();
}
}
...
@@ -889,7 +882,10 @@ void VIEW::updateItemGeometry( VIEW_ITEM* aItem, int aLayer )
...
@@ -889,7 +882,10 @@ void VIEW::updateItemGeometry( VIEW_ITEM* aItem, int aLayer )
group
=
m_gal
->
BeginGroup
();
group
=
m_gal
->
BeginGroup
();
aItem
->
setGroup
(
aLayer
,
group
);
aItem
->
setGroup
(
aLayer
,
group
);
m_painter
->
Draw
(
static_cast
<
EDA_ITEM
*>
(
aItem
),
aLayer
);
if
(
!
m_painter
->
Draw
(
static_cast
<
EDA_ITEM
*>
(
aItem
),
aLayer
)
);
aItem
->
ViewDraw
(
aLayer
,
m_gal
);
// Alternative drawing method
m_gal
->
EndGroup
();
m_gal
->
EndGroup
();
}
}
...
@@ -900,7 +896,7 @@ void VIEW::updateBbox( VIEW_ITEM* aItem )
...
@@ -900,7 +896,7 @@ void VIEW::updateBbox( VIEW_ITEM* aItem )
aItem
->
ViewGetLayers
(
layers
,
layers_count
);
aItem
->
ViewGetLayers
(
layers
,
layers_count
);
for
(
int
i
=
0
;
i
<
layers_count
;
i
++
)
for
(
int
i
=
0
;
i
<
layers_count
;
++
i
)
{
{
VIEW_LAYER
&
l
=
m_layers
[
layers
[
i
]];
VIEW_LAYER
&
l
=
m_layers
[
layers
[
i
]];
l
.
items
->
Remove
(
aItem
);
l
.
items
->
Remove
(
aItem
);
...
@@ -917,7 +913,7 @@ void VIEW::updateLayers( VIEW_ITEM* aItem )
...
@@ -917,7 +913,7 @@ void VIEW::updateLayers( VIEW_ITEM* aItem )
// Remove the item from previous layer set
// Remove the item from previous layer set
aItem
->
getLayers
(
layers
,
layers_count
);
aItem
->
getLayers
(
layers
,
layers_count
);
for
(
int
i
=
0
;
i
<
layers_count
;
i
++
)
for
(
int
i
=
0
;
i
<
layers_count
;
++
i
)
{
{
VIEW_LAYER
&
l
=
m_layers
[
layers
[
i
]];
VIEW_LAYER
&
l
=
m_layers
[
layers
[
i
]];
l
.
items
->
Remove
(
aItem
);
l
.
items
->
Remove
(
aItem
);
...
...
pcbnew/pcbframe.cpp
View file @
d583280b
...
@@ -578,13 +578,7 @@ void PCB_EDIT_FRAME::ViewReloadBoard( const BOARD* aBoard ) const
...
@@ -578,13 +578,7 @@ void PCB_EDIT_FRAME::ViewReloadBoard( const BOARD* aBoard ) const
std
::
string
(
aBoard
->
GetFileName
().
mb_str
()
),
std
::
string
(
aBoard
->
GetFileName
().
mb_str
()
),
std
::
string
(
GetScreenDesc
().
mb_str
()
),
std
::
string
(
GetScreenDesc
().
mb_str
()
),
&
GetPageSettings
(),
&
GetTitleBlock
()
);
&
GetPageSettings
(),
&
GetTitleBlock
()
);
BASE_SCREEN
*
screen
=
GetScreen
();
worksheet
->
ViewUpdate
(
KIGFX
::
VIEW_ITEM
::
GEOMETRY
);
if
(
screen
!=
NULL
)
{
worksheet
->
SetSheetNumber
(
GetScreen
()
->
m_ScreenNumber
);
worksheet
->
SetSheetCount
(
GetScreen
()
->
m_NumberOfScreens
);
}
view
->
Add
(
worksheet
);
view
->
Add
(
worksheet
);
// Add an entry for the ratsnest
// Add an entry for the ratsnest
...
@@ -715,10 +709,10 @@ void PCB_EDIT_FRAME::UseGalCanvas( bool aEnable )
...
@@ -715,10 +709,10 @@ void PCB_EDIT_FRAME::UseGalCanvas( bool aEnable )
{
{
EDA_DRAW_FRAME
::
UseGalCanvas
(
aEnable
);
EDA_DRAW_FRAME
::
UseGalCanvas
(
aEnable
);
ViewReloadBoard
(
m_Pcb
);
if
(
aEnable
)
if
(
aEnable
)
{
{
ViewReloadBoard
(
m_Pcb
);
// Update potential changes in the ratsnest
// Update potential changes in the ratsnest
m_Pcb
->
GetRatsnest
()
->
Recalculate
();
m_Pcb
->
GetRatsnest
()
->
Recalculate
();
...
...
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