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
dbc4a8f2
Commit
dbc4a8f2
authored
Mar 20, 2014
by
Maciej Suminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
GAL zooms in and out using the default hot keys (F1/F2).
Screen size is saved in VECTOR2I instead of VECTOR2D.
parent
093e311a
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
24 additions
and
23 deletions
+24
-23
cairo_gal.cpp
common/gal/cairo/cairo_gal.cpp
+3
-3
graphics_abstraction_layer.cpp
common/gal/graphics_abstraction_layer.cpp
+2
-2
opengl_gal.cpp
common/gal/opengl/opengl_gal.cpp
+2
-2
view.cpp
common/view/view.cpp
+1
-1
zoom.cpp
common/zoom.cpp
+3
-2
graphics_abstraction_layer.h
include/gal/graphics_abstraction_layer.h
+2
-2
view.h
include/view/view.h
+1
-1
menubar_pcbframe.cpp
pcbnew/menubar_pcbframe.cpp
+10
-10
No files found.
common/gal/cairo/cairo_gal.cpp
View file @
dbc4a8f2
...
...
@@ -70,7 +70,7 @@ CAIRO_GAL::CAIRO_GAL( wxWindow* aParent, wxEvtHandler* aMouseListener,
#endif
SetSize
(
aParent
->
GetSize
()
);
screenSize
=
VECTOR2
D
(
aParent
->
GetSize
()
);
screenSize
=
VECTOR2
I
(
aParent
->
GetSize
()
);
initCursor
();
// Grid color settings are different in Cairo and OpenGL
...
...
@@ -138,7 +138,7 @@ void CAIRO_GAL::EndDrawing()
*
wxOutputPtr
++
=
value
&
0xff
;
// Blue pixel
}
wxImage
img
(
(
int
)
screenSize
.
x
,
(
int
)
screenSize
.
y
,
(
unsigned
char
*
)
wxOutput
,
true
);
wxImage
img
(
screenSize
.
x
,
screenSize
.
y
,
(
unsigned
char
*
)
wxOutput
,
true
);
wxBitmap
bmp
(
img
);
wxClientDC
client_dc
(
this
);
wxBufferedDC
dc
;
...
...
@@ -283,7 +283,7 @@ void CAIRO_GAL::DrawCurve( const VECTOR2D& aStartPoint, const VECTOR2D& aControl
void
CAIRO_GAL
::
ResizeScreen
(
int
aWidth
,
int
aHeight
)
{
screenSize
=
VECTOR2
D
(
aWidth
,
aHeight
);
screenSize
=
VECTOR2
I
(
aWidth
,
aHeight
);
// Recreate the bitmaps
deleteBitmaps
();
...
...
common/gal/graphics_abstraction_layer.cpp
View file @
dbc4a8f2
...
...
@@ -88,7 +88,7 @@ void GAL::ComputeWorldScreenMatrix()
MATRIX3x3D
translation
;
translation
.
SetIdentity
();
translation
.
SetTranslation
(
0.5
*
screenSize
);
translation
.
SetTranslation
(
0.5
*
VECTOR2D
(
screenSize
)
);
MATRIX3x3D
scale
;
scale
.
SetIdentity
();
...
...
@@ -131,7 +131,7 @@ void GAL::DrawGrid()
// For the drawing the start points, end points and increments have
// to be calculated in world coordinates
VECTOR2D
worldStartPoint
=
screenWorldMatrix
*
VECTOR2D
(
0.0
,
0.0
);
VECTOR2D
worldEndPoint
=
screenWorldMatrix
*
screenSize
;
VECTOR2D
worldEndPoint
=
screenWorldMatrix
*
VECTOR2D
(
screenSize
)
;
int
gridScreenSizeDense
=
round
(
gridSize
.
x
*
worldScale
);
int
gridScreenSizeCoarse
=
round
(
gridSize
.
x
*
static_cast
<
double
>
(
gridTick
)
*
worldScale
);
...
...
common/gal/opengl/opengl_gal.cpp
View file @
dbc4a8f2
...
...
@@ -86,7 +86,7 @@ OPENGL_GAL::OPENGL_GAL( wxWindow* aParent, wxEvtHandler* aMouseListener,
#endif
SetSize
(
aParent
->
GetSize
()
);
screenSize
=
VECTOR2
D
(
aParent
->
GetSize
()
);
screenSize
=
VECTOR2
I
(
aParent
->
GetSize
()
);
// Grid color settings are different in Cairo and OpenGL
SetGridColor
(
COLOR4D
(
0.8
,
0.8
,
0.8
,
0.1
)
);
...
...
@@ -562,7 +562,7 @@ void OPENGL_GAL::DrawCurve( const VECTOR2D& aStartPoint, const VECTOR2D& aContro
void
OPENGL_GAL
::
ResizeScreen
(
int
aWidth
,
int
aHeight
)
{
screenSize
=
VECTOR2
D
(
aWidth
,
aHeight
);
screenSize
=
VECTOR2
I
(
aWidth
,
aHeight
);
// Resize framebuffers
compositor
.
Resize
(
aWidth
,
aHeight
);
...
...
common/view/view.cpp
View file @
dbc4a8f2
...
...
@@ -771,7 +771,7 @@ void VIEW::Redraw()
}
const
VECTOR2
D
&
VIEW
::
GetScreenPixelSize
()
const
const
VECTOR2
I
&
VIEW
::
GetScreenPixelSize
()
const
{
return
m_gal
->
GetScreenPixelSize
();
}
...
...
common/zoom.cpp
View file @
dbc4a8f2
...
...
@@ -203,8 +203,9 @@ void EDA_DRAW_FRAME::OnZoom( wxCommandEvent& event )
double
zoomFactor
=
gal
->
GetWorldScale
()
/
gal
->
GetZoomFactor
();
double
zoom
=
1.0
/
(
zoomFactor
*
GetZoom
()
);
view
->
SetScale
(
zoom
);
view
->
SetCenter
(
VECTOR2D
(
center
)
);
VECTOR2D
cursorWorld
(
GetCrossHairPosition
()
);
view
->
SetScale
(
zoom
,
cursorWorld
);
GetGalCanvas
()
->
Refresh
();
}
...
...
include/gal/graphics_abstraction_layer.h
View file @
dbc4a8f2
...
...
@@ -160,7 +160,7 @@ public:
virtual
bool
Show
(
bool
aShow
)
=
0
;
/// @brief Returns GAL canvas size in pixels
const
VECTOR2
D
&
GetScreenPixelSize
()
const
const
VECTOR2
I
&
GetScreenPixelSize
()
const
{
return
screenSize
;
}
...
...
@@ -831,7 +831,7 @@ public:
protected
:
std
::
stack
<
double
>
depthStack
;
///< Stored depth values
VECTOR2
D
screenSize
;
///< Screen size in screen coordinates
VECTOR2
I
screenSize
;
///< Screen size in screen coordinates
double
worldUnitLength
;
///< The unit length of the world coordinates [inch]
double
screenDPI
;
///< The dots per inch of the screen
...
...
include/view/view.h
View file @
dbc4a8f2
...
...
@@ -261,7 +261,7 @@ public:
* Returns the size of the our rendering area, in pixels.
* @return viewport screen size
*/
const
VECTOR2
D
&
GetScreenPixelSize
()
const
;
const
VECTOR2
I
&
GetScreenPixelSize
()
const
;
/**
* Function AddLayer()
...
...
pcbnew/menubar_pcbframe.cpp
View file @
dbc4a8f2
...
...
@@ -328,12 +328,12 @@ void PCB_EDIT_FRAME::ReCreateMenuBar()
*/
// Zoom In
text
=
AddHotkeyName
(
_
(
"Zoom &In"
),
g_Pcbnew_Editor_Hokeys_Descr
,
HK_ZOOM_IN
,
IS_ACCELERATOR
);
HK_ZOOM_IN
);
AddMenuItem
(
viewMenu
,
ID_ZOOM_IN
,
text
,
HELP_ZOOM_IN
,
KiBitmap
(
zoom_in_xpm
)
);
// Zoom Out
text
=
AddHotkeyName
(
_
(
"Zoom &Out"
),
g_Pcbnew_Editor_Hokeys_Descr
,
HK_ZOOM_OUT
,
IS_ACCELERATOR
);
HK_ZOOM_OUT
);
AddMenuItem
(
viewMenu
,
ID_ZOOM_OUT
,
text
,
HELP_ZOOM_OUT
,
KiBitmap
(
zoom_out_xpm
)
);
// Fit on Screen
...
...
@@ -366,21 +366,21 @@ void PCB_EDIT_FRAME::ReCreateMenuBar()
viewMenu
->
AppendSeparator
();
text
=
AddHotkeyName
(
_
(
"&Switch canvas to default"
),
g_Pcbnew_Editor_Hokeys_Descr
,
HK_CANVAS_DEFAULT
,
IS_ACCELERATOR
);
HK_CANVAS_DEFAULT
);
AddMenuItem
(
viewMenu
,
ID_MENU_CANVAS_DEFAULT
,
text
,
_
(
"Switch the canvas implementation to default"
),
KiBitmap
(
tools_xpm
)
);
text
=
AddHotkeyName
(
_
(
"&Switch canvas to OpenGL"
),
g_Pcbnew_Editor_Hokeys_Descr
,
HK_CANVAS_OPENGL
,
IS_ACCELERATOR
);
HK_CANVAS_OPENGL
);
AddMenuItem
(
viewMenu
,
ID_MENU_CANVAS_OPENGL
,
text
,
_
(
"Switch the canvas implementation to OpenGL"
),
KiBitmap
(
tools_xpm
)
);
text
=
AddHotkeyName
(
_
(
"&Switch canvas to Cairo"
),
g_Pcbnew_Editor_Hokeys_Descr
,
HK_CANVAS_CAIRO
,
IS_ACCELERATOR
);
HK_CANVAS_CAIRO
);
AddMenuItem
(
viewMenu
,
ID_MENU_CANVAS_CAIRO
,
text
,
_
(
"Switch the canvas implementation to Cairo"
),
...
...
@@ -391,13 +391,13 @@ void PCB_EDIT_FRAME::ReCreateMenuBar()
// Module
text
=
AddHotkeyName
(
_
(
"&Module"
),
g_Pcbnew_Editor_Hokeys_Descr
,
HK_ADD_MODULE
,
IS_ACCELERATOR
);
HK_ADD_MODULE
);
AddMenuItem
(
placeMenu
,
ID_PCB_MODULE_BUTT
,
text
,
_
(
"Add modules"
),
KiBitmap
(
module_xpm
)
);
// Track
text
=
AddHotkeyName
(
_
(
"&Track"
),
g_Pcbnew_Editor_Hokeys_Descr
,
HK_ADD_NEW_TRACK
,
IS_ACCELERATOR
);
HK_ADD_NEW_TRACK
);
AddMenuItem
(
placeMenu
,
ID_TRACK_BUTT
,
text
,
_
(
"Add tracks and vias"
),
KiBitmap
(
add_tracks_xpm
)
);
...
...
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