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
5eddb1f4
Commit
5eddb1f4
authored
Jan 15, 2010
by
charras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed flicker when zooming. (wxGTK specific)
parent
37309e1a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
4 deletions
+14
-4
drawpanel.cpp
common/drawpanel.cpp
+5
-2
zoom.cpp
common/zoom.cpp
+9
-2
No files found.
common/drawpanel.cpp
View file @
5eddb1f4
...
@@ -769,7 +769,7 @@ void WinEDA_DrawPanel::DrawBackGround( wxDC* DC )
...
@@ -769,7 +769,7 @@ void WinEDA_DrawPanel::DrawBackGround( wxDC* DC )
// Under linux, to be tested (could be depend on linux versions
// Under linux, to be tested (could be depend on linux versions
// so perhaps could be necessary to set this option at run time.
// so perhaps could be necessary to set this option at run time.
#if
defined ( __WXMAC__ )
#if
ndef __WXMSW__
// Use a pixel based draw to display grid
// Use a pixel based draw to display grid
// There is a lot of calls, so the cost is hight
// There is a lot of calls, so the cost is hight
// and grid is slowly drawn on some platforms
// and grid is slowly drawn on some platforms
...
@@ -795,7 +795,7 @@ void WinEDA_DrawPanel::DrawBackGround( wxDC* DC )
...
@@ -795,7 +795,7 @@ void WinEDA_DrawPanel::DrawBackGround( wxDC* DC )
// But this is fast if the Blit function is fast. Not true on all platforms
// But this is fast if the Blit function is fast. Not true on all platforms
// a grid column is drawn; and then copied to others grid columns
// 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.
// this is possible because the grid is drawn only after clearing the screen.
// under MACOSX, is very slow
// under MACOSX, is very slow
and seems crash under Linux
ii
=
1
;
ii
=
1
;
xg
=
wxRound
(
ii
*
screen_grid_size
.
x
);
xg
=
wxRound
(
ii
*
screen_grid_size
.
x
);
int
x0pos
=
GRMapX
(
org
.
x
+
xg
);
int
x0pos
=
GRMapX
(
org
.
x
+
xg
);
...
@@ -925,6 +925,9 @@ void WinEDA_DrawPanel::OnMouseLeaving( wxMouseEvent& event )
...
@@ -925,6 +925,9 @@ void WinEDA_DrawPanel::OnMouseLeaving( wxMouseEvent& event )
*/
*/
void
WinEDA_DrawPanel
::
OnMouseWheel
(
wxMouseEvent
&
event
)
void
WinEDA_DrawPanel
::
OnMouseWheel
(
wxMouseEvent
&
event
)
{
{
if
(
m_IgnoreMouseEvents
)
return
;
wxRect
rect
=
wxRect
(
wxPoint
(
0
,
0
),
GetClientSize
()
);
wxRect
rect
=
wxRect
(
wxPoint
(
0
,
0
),
GetClientSize
()
);
/* Ignore scroll events if the cursor is outside the drawing area. */
/* Ignore scroll events if the cursor is outside the drawing area. */
...
...
common/zoom.cpp
View file @
5eddb1f4
...
@@ -26,15 +26,22 @@ void WinEDA_DrawFrame::Recadre_Trace( bool ToMouse )
...
@@ -26,15 +26,22 @@ void WinEDA_DrawFrame::Recadre_Trace( bool ToMouse )
{
{
PutOnGrid
(
&
(
GetBaseScreen
()
->
m_Curseur
)
);
PutOnGrid
(
&
(
GetBaseScreen
()
->
m_Curseur
)
);
AdjustScrollBars
();
AdjustScrollBars
();
DrawPanel
->
m_IgnoreMouseEvents
=
true
;
DrawPanel
->
Refresh
();
// send OnPaint event
DrawPanel
->
Refresh
();
// send OnPaint event
wxSafeYield
();
// needed to allow OnPaint event execution here
// wxSafeYield() is better here, but creates flicker under Linux
// because it temporary disables menus and toolbars
// TODO: find a better way to manage refresh screen and mouse move
wxYield
();
// needed to allow OnPaint event execution here
DrawPanel
->
m_IgnoreMouseEvents
=
false
;
/* Move the mouse cursor to the on grid graphic cursor position */
/* Move the mouse cursor to the on grid graphic cursor position */
if
(
ToMouse
==
TRUE
)
if
(
ToMouse
==
TRUE
)
{
{
DrawPanel
->
MouseToCursorSchema
();
DrawPanel
->
MouseToCursorSchema
();
}
}
}
}
/** Adjust the coordinate to the nearest grid value
/** Adjust the coordinate to the nearest grid value
...
...
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