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
6824dc71
Commit
6824dc71
authored
May 08, 2012
by
Dick Hollenbeck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
this helps zooming on some window types
parent
40ccdd57
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
7 deletions
+13
-7
drawframe.cpp
common/drawframe.cpp
+13
-7
No files found.
common/drawframe.cpp
View file @
6824dc71
...
@@ -394,7 +394,7 @@ void EDA_DRAW_FRAME::OnSelectZoom( wxCommandEvent& event )
...
@@ -394,7 +394,7 @@ void EDA_DRAW_FRAME::OnSelectZoom( wxCommandEvent& event )
}
}
double
EDA_DRAW_FRAME
::
GetZoom
(
void
)
double
EDA_DRAW_FRAME
::
GetZoom
()
{
{
return
GetScreen
()
->
GetZoom
();
return
GetScreen
()
->
GetZoom
();
}
}
...
@@ -697,7 +697,7 @@ void EDA_DRAW_FRAME::AdjustScrollBars( const wxPoint& aCenterPositionIU )
...
@@ -697,7 +697,7 @@ void EDA_DRAW_FRAME::AdjustScrollBars( const wxPoint& aCenterPositionIU )
double
scale
=
screen
->
GetScalingFactor
();
double
scale
=
screen
->
GetScalingFactor
();
wxLogTrace
(
traceScrollSettings
,
wxT
(
"Center Position = ( %d, %d ), scale = %.1
6
g"
),
wxLogTrace
(
traceScrollSettings
,
wxT
(
"Center Position = ( %d, %d ), scale = %.1
0
g"
),
aCenterPositionIU
.
x
,
aCenterPositionIU
.
y
,
scale
);
aCenterPositionIU
.
x
,
aCenterPositionIU
.
y
,
scale
);
// Calculate the portion of the drawing that can be displayed in the
// Calculate the portion of the drawing that can be displayed in the
...
@@ -742,6 +742,12 @@ void EDA_DRAW_FRAME::AdjustScrollBars( const wxPoint& aCenterPositionIU )
...
@@ -742,6 +742,12 @@ void EDA_DRAW_FRAME::AdjustScrollBars( const wxPoint& aCenterPositionIU )
centerPositionIU
.
x
=
KiROUND
(
clientRectIU
.
x
+
clientRectIU
.
width
/
2
);
centerPositionIU
.
x
=
KiROUND
(
clientRectIU
.
x
+
clientRectIU
.
width
/
2
);
centerPositionIU
.
y
=
KiROUND
(
clientRectIU
.
y
+
clientRectIU
.
height
/
2
);
centerPositionIU
.
y
=
KiROUND
(
clientRectIU
.
y
+
clientRectIU
.
height
/
2
);
if
(
screen
->
m_Center
)
{
centerPositionIU
.
x
-=
KiROUND
(
pageRectIU
.
width
/
2.0
);
centerPositionIU
.
y
-=
KiROUND
(
pageRectIU
.
height
/
2.0
);
}
DSIZE
virtualSizeIU
;
DSIZE
virtualSizeIU
;
if
(
pageRectIU
.
GetLeft
()
<
clientRectIU
.
GetLeft
()
&&
pageRectIU
.
GetRight
()
>
clientRectIU
.
GetRight
()
)
if
(
pageRectIU
.
GetLeft
()
<
clientRectIU
.
GetLeft
()
&&
pageRectIU
.
GetRight
()
>
clientRectIU
.
GetRight
()
)
...
@@ -846,25 +852,25 @@ void EDA_DRAW_FRAME::AdjustScrollBars( const wxPoint& aCenterPositionIU )
...
@@ -846,25 +852,25 @@ void EDA_DRAW_FRAME::AdjustScrollBars( const wxPoint& aCenterPositionIU )
if
(
posX
<
0
)
if
(
posX
<
0
)
{
{
wxLogTrace
(
traceScrollSettings
,
wxT
(
"Required scroll bar X position %.1
6
g"
),
posX
);
wxLogTrace
(
traceScrollSettings
,
wxT
(
"Required scroll bar X position %.1
0
g"
),
posX
);
posX
=
0
;
posX
=
0
;
}
}
if
(
posX
>
unitsX
)
if
(
posX
>
unitsX
)
{
{
wxLogTrace
(
traceScrollSettings
,
wxT
(
"Required scroll bar X position %.1
6
g"
),
posX
);
wxLogTrace
(
traceScrollSettings
,
wxT
(
"Required scroll bar X position %.1
0
g"
),
posX
);
posX
=
unitsX
;
posX
=
unitsX
;
}
}
if
(
posY
<
0
)
if
(
posY
<
0
)
{
{
wxLogTrace
(
traceScrollSettings
,
wxT
(
"Required scroll bar Y position %.1
6
g"
),
posY
);
wxLogTrace
(
traceScrollSettings
,
wxT
(
"Required scroll bar Y position %.1
0
g"
),
posY
);
posY
=
0
;
posY
=
0
;
}
}
if
(
posY
>
unitsY
)
if
(
posY
>
unitsY
)
{
{
wxLogTrace
(
traceScrollSettings
,
wxT
(
"Required scroll bar Y position %.1
6
g"
),
posY
);
wxLogTrace
(
traceScrollSettings
,
wxT
(
"Required scroll bar Y position %.1
0
g"
),
posY
);
posY
=
unitsY
;
posY
=
unitsY
;
}
}
...
@@ -872,7 +878,7 @@ void EDA_DRAW_FRAME::AdjustScrollBars( const wxPoint& aCenterPositionIU )
...
@@ -872,7 +878,7 @@ void EDA_DRAW_FRAME::AdjustScrollBars( const wxPoint& aCenterPositionIU )
screen
->
m_ScrollbarNumber
=
wxSize
(
KiROUND
(
unitsX
),
KiROUND
(
unitsY
)
);
screen
->
m_ScrollbarNumber
=
wxSize
(
KiROUND
(
unitsX
),
KiROUND
(
unitsY
)
);
wxLogTrace
(
traceScrollSettings
,
wxLogTrace
(
traceScrollSettings
,
wxT
(
"Drawing = (%.1
6g, %.16g), Client = (%.16g, %.16
g), Offset = (%d, %d), SetScrollbars(%d, %d, %d, %d, %d, %d)"
),
wxT
(
"Drawing = (%.1
0g, %.10g), Client = (%.10g, %.10
g), Offset = (%d, %d), SetScrollbars(%d, %d, %d, %d, %d, %d)"
),
virtualSizeIU
.
x
,
virtualSizeIU
.
y
,
clientSizeIU
.
x
,
clientSizeIU
.
y
,
virtualSizeIU
.
x
,
virtualSizeIU
.
y
,
clientSizeIU
.
x
,
clientSizeIU
.
y
,
screen
->
m_DrawOrg
.
x
,
screen
->
m_DrawOrg
.
y
,
screen
->
m_DrawOrg
.
x
,
screen
->
m_DrawOrg
.
y
,
screen
->
m_ScrollPixelsPerUnitX
,
screen
->
m_ScrollPixelsPerUnitY
,
screen
->
m_ScrollPixelsPerUnitX
,
screen
->
m_ScrollPixelsPerUnitY
,
...
...
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