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
38ea6008
Commit
38ea6008
authored
Apr 12, 2012
by
lajos kamocsay
Committed by
jean-pierre charras
Apr 12, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix small issue when panning with middle button.
parent
b4bb924e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
0 deletions
+19
-0
drawpanel.cpp
common/drawpanel.cpp
+19
-0
No files found.
common/drawpanel.cpp
View file @
38ea6008
...
...
@@ -338,6 +338,9 @@ void EDA_DRAW_PANEL::OnScroll( wxScrollWinEvent& event )
GetClientSize
(
&
csizeX
,
&
csizeY
);
GetVirtualSize
(
&
unitsX
,
&
unitsY
);
int
tmpX
=
x
;
int
tmpY
=
y
;
csizeX
/=
ppux
;
csizeY
/=
ppuy
;
...
...
@@ -399,6 +402,13 @@ void EDA_DRAW_PANEL::OnScroll( wxScrollWinEvent& event )
wxT
(
"Setting scroll bars ppuX=%d, ppuY=%d, unitsX=%d, unitsY=%d, posX=%d, posY=%d"
),
ppux
,
ppuy
,
unitsX
,
unitsY
,
x
,
y
);
double
scale
=
GetParent
()
->
GetScreen
()
->
GetScalingFactor
();
wxPoint
center
=
GetParent
()
->
GetScreen
()
->
GetScrollCenterPosition
();
center
.
x
+=
wxRound
(
(
double
)
(
x
-
tmpX
)
/
scale
);
center
.
y
+=
wxRound
(
(
double
)
(
y
-
tmpY
)
/
scale
);
GetParent
()
->
GetScreen
()
->
SetScrollCenterPosition
(
center
);
Scroll
(
x
,
y
);
event
.
Skip
();
}
...
...
@@ -1007,11 +1017,13 @@ void EDA_DRAW_PANEL::OnMouseEvent( wxMouseEvent& event )
if
(
m_panScrollbarLimits
)
{
int
x
,
y
;
int
tmpX
,
tmpY
;
int
ppux
,
ppuy
;
int
maxX
,
maxY
;
int
vsizeX
,
vsizeY
;
int
csizeX
,
csizeY
;
GetViewStart
(
&
tmpX
,
&
tmpY
);
GetScrollPixelsPerUnit
(
&
ppux
,
&
ppuy
);
GetVirtualSize
(
&
vsizeX
,
&
vsizeY
);
GetClientSize
(
&
csizeX
,
&
csizeY
);
...
...
@@ -1057,6 +1069,13 @@ void EDA_DRAW_PANEL::OnMouseEvent( wxMouseEvent& event )
Scroll
(
x
/
ppux
,
y
/
ppuy
);
double
scale
=
GetParent
()
->
GetScreen
()
->
GetScalingFactor
();
wxPoint
center
=
GetParent
()
->
GetScreen
()
->
GetScrollCenterPosition
();
center
.
x
+=
wxRound
(
(
double
)
(
x
-
tmpX
)
/
scale
)
/
ppux
;
center
.
y
+=
wxRound
(
(
double
)
(
y
-
tmpY
)
/
scale
)
/
ppuy
;
GetParent
()
->
GetScreen
()
->
SetScrollCenterPosition
(
center
);
Refresh
();
Update
();
}
...
...
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