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
39624641
Commit
39624641
authored
Aug 26, 2013
by
Maciej Suminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed linking errors for apps other than pcbnew.
parent
b03f97b9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
22 deletions
+35
-22
drawpanel_gal.cpp
common/drawpanel_gal.cpp
+4
-0
view.cpp
common/view/view.cpp
+17
-14
view.h
include/view/view.h
+14
-8
No files found.
common/drawpanel_gal.cpp
View file @
39624641
...
...
@@ -143,6 +143,10 @@ void EDA_DRAW_PANEL_GAL::Refresh( bool eraseBackground, const wxRect* rect )
m_gal
->
SetBackgroundColor
(
KiGfx
::
COLOR4D
(
0.0
,
0.0
,
0.0
,
1.0
)
);
m_gal
->
ClearScreen
();
m_view
->
PrepareTargets
();
// Grid has to be redrawn only when the NONCACHED target is redrawn
if
(
m_view
->
IsTargetDirty
(
KiGfx
::
TARGET_NONCACHED
)
)
m_gal
->
DrawGrid
();
m_view
->
Redraw
();
m_gal
->
EndDrawing
();
...
...
common/view/view.cpp
View file @
39624641
...
...
@@ -546,7 +546,7 @@ void VIEW::redrawRect( const BOX2I& aRect )
{
BOOST_FOREACH
(
VIEW_LAYER
*
l
,
m_orderedLayers
)
{
if
(
l
->
enabled
&&
i
sTargetDirty
(
l
->
target
)
&&
areRequiredLayersEnabled
(
l
->
id
)
)
if
(
l
->
enabled
&&
I
sTargetDirty
(
l
->
target
)
&&
areRequiredLayersEnabled
(
l
->
id
)
)
{
drawItem
drawFunc
(
this
,
l
);
...
...
@@ -622,7 +622,7 @@ bool VIEW::IsDirty() const
{
for
(
int
i
=
0
;
i
<
TARGETS_NUMBER
;
++
i
)
{
if
(
i
sTargetDirty
(
i
)
)
if
(
I
sTargetDirty
(
i
)
)
return
true
;
}
...
...
@@ -695,14 +695,9 @@ void VIEW::Clear()
}
void
VIEW
::
Redraw
()
void
VIEW
::
PrepareTargets
()
{
VECTOR2D
screenSize
=
m_gal
->
GetScreenPixelSize
();
BOX2I
rect
(
ToWorld
(
VECTOR2D
(
0
,
0
)
),
ToWorld
(
screenSize
)
-
ToWorld
(
VECTOR2D
(
0
,
0
)
)
);
rect
.
Normalize
();
if
(
isTargetDirty
(
TARGET_CACHED
)
||
isTargetDirty
(
TARGET_NONCACHED
)
)
if
(
IsTargetDirty
(
TARGET_CACHED
)
||
IsTargetDirty
(
TARGET_NONCACHED
)
)
{
// TARGET_CACHED and TARGET_NONCACHED have to be redrawn together, as they contain
// layers that rely on each other (eg. netnames are noncached, but tracks - are cached)
...
...
@@ -711,13 +706,21 @@ void VIEW::Redraw()
MarkTargetDirty
(
TARGET_NONCACHED
);
MarkTargetDirty
(
TARGET_CACHED
);
}
m_gal
->
DrawGrid
();
if
(
IsTargetDirty
(
TARGET_OVERLAY
)
)
{
m_gal
->
ClearTarget
(
TARGET_OVERLAY
);
}
}
// Always refresh the overlay
MarkTargetDirty
(
TARGET_OVERLAY
);
m_gal
->
ClearTarget
(
TARGET_OVERLAY
);
void
VIEW
::
Redraw
()
{
VECTOR2D
screenSize
=
m_gal
->
GetScreenPixelSize
();
BOX2I
rect
(
ToWorld
(
VECTOR2D
(
0
,
0
)
),
ToWorld
(
screenSize
)
-
ToWorld
(
VECTOR2D
(
0
,
0
)
)
);
rect
.
Normalize
();
redrawRect
(
rect
);
...
...
@@ -892,7 +895,7 @@ void VIEW::RecacheAllItems( bool aImmediately )
}
bool
VIEW
::
i
sTargetDirty
(
int
aTarget
)
const
bool
VIEW
::
I
sTargetDirty
(
int
aTarget
)
const
{
wxASSERT
(
aTarget
<
TARGETS_NUMBER
);
...
...
include/view/view.h
View file @
39624641
...
...
@@ -362,6 +362,12 @@ public:
*/
void
UpdateAllLayersOrder
();
/**
* Function PrepareTargets()
* Clears targets that are marked as dirty.
*/
void
PrepareTargets
();
/**
* Function Redraw()
* Immediately redraws the whole view.
...
...
@@ -397,6 +403,14 @@ public:
*/
bool
IsDirty
()
const
;
/**
* Function IsTargetDirty()
* Returns true if any of layers belonging to the target or the target itself should be
* redrawn.
* @return True if the above condition is fulfilled.
*/
bool
IsTargetDirty
(
int
aTarget
)
const
;
/**
* Function MarkTargetDirty()
* Sets or clears target 'dirty' flag.
...
...
@@ -516,14 +530,6 @@ private:
return
(
m_layers
.
at
(
aLayer
).
target
==
TARGET_CACHED
);
}
/**
* Function isTargetDirty()
* Returns true if any of layers belonging to the target or the target itself should be
* redrawn.
* @return True if the above condition is fulfilled.
*/
bool
isTargetDirty
(
int
aTarget
)
const
;
///* Whether to use rendering order modifier or not
bool
m_enableOrderModifier
;
...
...
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