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
08fd9d8c
Commit
08fd9d8c
authored
Dec 02, 2013
by
Maciej Suminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Overridden ViewUpdate() for MODULE class, so it handles its pads, drawings and texts.
parent
4876dbea
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
35 additions
and
7 deletions
+35
-7
view.cpp
common/view/view.cpp
+1
-1
view_item.cpp
common/view/view_item.cpp
+1
-1
view.h
include/view/view.h
+8
-5
class_module.cpp
pcbnew/class_module.cpp
+22
-0
class_module.h
pcbnew/class_module.h
+3
-0
No files found.
common/view/view.cpp
View file @
08fd9d8c
...
@@ -819,7 +819,7 @@ void VIEW::clearGroupCache()
...
@@ -819,7 +819,7 @@ void VIEW::clearGroupCache()
}
}
void
VIEW
::
i
nvalidateItem
(
VIEW_ITEM
*
aItem
,
int
aUpdateFlags
)
void
VIEW
::
I
nvalidateItem
(
VIEW_ITEM
*
aItem
,
int
aUpdateFlags
)
{
{
// updateLayers updates geometry too, so we do not have to update both of them at the same time
// updateLayers updates geometry too, so we do not have to update both of them at the same time
if
(
aUpdateFlags
&
VIEW_ITEM
::
LAYERS
)
if
(
aUpdateFlags
&
VIEW_ITEM
::
LAYERS
)
...
...
common/view/view_item.cpp
View file @
08fd9d8c
...
@@ -53,7 +53,7 @@ void VIEW_ITEM::ViewUpdate( int aUpdateFlags )
...
@@ -53,7 +53,7 @@ void VIEW_ITEM::ViewUpdate( int aUpdateFlags )
if
(
!
m_view
)
if
(
!
m_view
)
return
;
return
;
m_view
->
i
nvalidateItem
(
this
,
aUpdateFlags
);
m_view
->
I
nvalidateItem
(
this
,
aUpdateFlags
);
}
}
...
...
include/view/view.h
View file @
08fd9d8c
...
@@ -493,6 +493,14 @@ public:
...
@@ -493,6 +493,14 @@ public:
m_scaleLimits
=
VECTOR2D
(
aMaximum
,
aMinimum
);
m_scaleLimits
=
VECTOR2D
(
aMaximum
,
aMinimum
);
}
}
/**
* Function InvalidateItem()
* Manages dirty flags & redraw queueing when updating an item.
* @param aItem is the item to be updated.
* @param aUpdateFlags determines the way an item is refreshed.
*/
void
InvalidateItem
(
VIEW_ITEM
*
aItem
,
int
aUpdateFlags
);
static
const
int
VIEW_MAX_LAYERS
=
128
;
///* maximum number of layers that may be shown
static
const
int
VIEW_MAX_LAYERS
=
128
;
///* maximum number of layers that may be shown
private
:
private
:
...
@@ -563,11 +571,6 @@ private:
...
@@ -563,11 +571,6 @@ private:
*/
*/
void
draw
(
VIEW_GROUP
*
aGroup
,
bool
aImmediate
=
false
)
const
;
void
draw
(
VIEW_GROUP
*
aGroup
,
bool
aImmediate
=
false
)
const
;
///* Manages dirty flags & redraw queueing when updating an item. Called internally
/// via VIEW_ITEM::ViewUpdate()
void
invalidateItem
(
VIEW_ITEM
*
aItem
,
int
aUpdateFlags
);
///* Sorts m_orderedLayers when layer rendering order has changed
///* Sorts m_orderedLayers when layer rendering order has changed
void
sortLayers
();
void
sortLayers
();
...
...
pcbnew/class_module.cpp
View file @
08fd9d8c
...
@@ -728,6 +728,28 @@ EDA_ITEM* MODULE::Clone() const
...
@@ -728,6 +728,28 @@ EDA_ITEM* MODULE::Clone() const
}
}
void
MODULE
::
ViewUpdate
(
int
aUpdateFlags
)
{
if
(
!
m_view
)
return
;
// Update pads
for
(
D_PAD
*
pad
=
m_Pads
.
GetFirst
();
pad
;
pad
=
pad
->
Next
()
)
m_view
->
InvalidateItem
(
pad
,
aUpdateFlags
);
// Update module's drawing (mostly silkscreen)
for
(
BOARD_ITEM
*
drawing
=
m_Drawings
.
GetFirst
();
drawing
;
drawing
=
drawing
->
Next
()
)
m_view
->
InvalidateItem
(
drawing
,
aUpdateFlags
);
// Update module's texts
m_view
->
InvalidateItem
(
m_Reference
,
aUpdateFlags
);
m_view
->
InvalidateItem
(
m_Value
,
aUpdateFlags
);
// Update the module itself
m_view
->
InvalidateItem
(
this
,
aUpdateFlags
);
}
/* Test for validity of the name in a library of the footprint
/* Test for validity of the name in a library of the footprint
* ( no spaces, dir separators ... )
* ( no spaces, dir separators ... )
* return true if the given name is valid
* return true if the given name is valid
...
...
pcbnew/class_module.h
View file @
08fd9d8c
...
@@ -447,6 +447,9 @@ public:
...
@@ -447,6 +447,9 @@ public:
EDA_ITEM
*
Clone
()
const
;
EDA_ITEM
*
Clone
()
const
;
/// @copydoc VIEW_ITEM::ViewUpdate()
void
ViewUpdate
(
int
aUpdateFlags
);
/**
/**
* Function CopyNetlistSettings
* Function CopyNetlistSettings
* copies the netlist settings to \a aModule.
* copies the netlist settings to \a aModule.
...
...
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