Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
P
Printrun
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
machinery
Printrun
Commits
2b00ea6a
Commit
2b00ea6a
authored
Apr 02, 2014
by
Guillaume Seguin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix #513 by correctly tracking width and height resize ratios
parent
5f97c0bf
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
1 deletion
+8
-1
panel.py
printrun/gl/panel.py
+8
-1
No files found.
printrun/gl/panel.py
View file @
2b00ea6a
...
...
@@ -163,9 +163,14 @@ class wxGLPanel(wx.Panel):
self
.
reset_mview
(
0.9
)
self
.
mview_initialized
=
True
elif
oldwidth
is
not
None
and
oldheight
is
not
None
:
factor
=
min
(
self
.
width
/
oldwidth
,
self
.
height
/
oldheight
)
wratio
=
self
.
width
/
oldwidth
hratio
=
self
.
height
/
oldheight
factor
=
min
(
wratio
*
self
.
zoomed_width
,
hratio
*
self
.
zoomed_height
)
x
,
y
,
_
=
self
.
mouse_to_3d
(
self
.
width
/
2
,
self
.
height
/
2
)
self
.
zoom
(
factor
,
(
x
,
y
))
self
.
zoomed_width
*=
wratio
/
factor
self
.
zoomed_height
*=
hratio
/
factor
# Wrap text to the width of the window
if
self
.
GLinitialized
:
...
...
@@ -200,6 +205,8 @@ class wxGLPanel(wx.Panel):
if
self
.
orthographic
:
ratio
=
factor
*
float
(
max
(
self
.
width
,
self
.
height
))
/
self
.
dist
self
.
zoom_factor
=
1.0
self
.
zoomed_width
=
1.0
self
.
zoomed_height
=
1.0
glScalef
(
ratio
,
ratio
,
1
)
def
OnDraw
(
self
,
*
args
,
**
kwargs
):
...
...
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