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
4936ca3a
Commit
4936ca3a
authored
Jan 13, 2010
by
charras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Testing a new fast draw algo to draw grid.
parent
6efce74c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
3 deletions
+32
-3
drawpanel.cpp
common/drawpanel.cpp
+32
-3
No files found.
common/drawpanel.cpp
View file @
4936ca3a
...
...
@@ -757,14 +757,18 @@ void WinEDA_DrawPanel::DrawBackGround( wxDC* DC )
if
(
drawgrid
)
{
m_Parent
->
PutOnGrid
(
&
org
);
GRSetColorPen
(
DC
,
color
);
int
xpos
,
ypos
;
#if 0 // Use a pixel based draw to display grid
// There is a lot of calls, so the cost is hight
// and grid is slowly drawn on some platforms
for( ii = 0; ; ii++ )
{
xg = wxRound(ii * screen_grid_size.x);
if( xg > size.x )
break;
int
xpos
=
org
.
x
+
xg
;
xpos = org.x + xg;
xpos = GRMapX( xpos );
for( jj = 0; ; jj++ )
{
...
...
@@ -775,7 +779,32 @@ void WinEDA_DrawPanel::DrawBackGround( wxDC* DC )
DC->DrawPoint( xpos, GRMapY( ypos ) );
}
}
}
#else
// Currently on test: Use a fast way to draw the grid
// a grid column is drawn; and then copied to others grid columns
// this is possible because the grid is drawn only after clearing the screen.
ii
=
1
;
xg
=
wxRound
(
ii
*
screen_grid_size
.
x
);
int
x0pos
=
GRMapX
(
org
.
x
+
xg
);
for
(
jj
=
0
;
;
jj
++
)
{
yg
=
wxRound
(
jj
*
screen_grid_size
.
y
);
if
(
yg
>
size
.
y
)
break
;
ypos
=
org
.
y
+
yg
;
DC
->
DrawPoint
(
x0pos
,
GRMapY
(
ypos
)
);
}
ypos
=
GRMapY
(
org
.
y
);
for
(
ii
=
2
;
;
ii
++
)
{
xg
=
wxRound
(
ii
*
screen_grid_size
.
x
);
if
(
xg
>
size
.
x
)
break
;
xpos
=
GRMapX
(
org
.
x
+
xg
);
DC
->
Blit
(
xpos
,
ypos
,
1
,
size
.
y
,
DC
,
x0pos
,
ypos
);
}
#endif
}
/* Draw axis */
...
...
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