projects
/
rocksndiamonds.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
e761f71
)
fixed calculating window size percentage after resizing
author
Holger Schemel
<info@artsoft.org>
Mon, 10 Apr 2017 22:00:16 +0000
(
00:00
+0200)
committer
Holger Schemel
<info@artsoft.org>
Mon, 10 Apr 2017 22:00:16 +0000
(
00:00
+0200)
src/events.c
patch
|
blob
|
history
diff --git
a/src/events.c
b/src/events.c
index e2d5ab9bdb47ef3fb81caed64112dd411b9e6a63..25d243b7b105f5beb368b203e7195ee97a1bc450 100644
(file)
--- a/
src/events.c
+++ b/
src/events.c
@@
-532,8
+532,8
@@
void HandleWindowEvent(WindowEvent *event)
if (new_window_width != video.window_width ||
new_window_height != video.window_height)
{
if (new_window_width != video.window_width ||
new_window_height != video.window_height)
{
- int new_xpercent =
(100 * new_window_width / video.screen_width)
;
- int new_ypercent =
(100 * new_window_height / video.screen_height)
;
+ int new_xpercent =
100.0 * new_window_width / video.screen_width + .5
;
+ int new_ypercent =
100.0 * new_window_height / video.screen_height + .5
;
// (extreme window scaling allowed, but cannot be saved permanently)
video.window_scaling_percent = MIN(new_xpercent, new_ypercent);
// (extreme window scaling allowed, but cannot be saved permanently)
video.window_scaling_percent = MIN(new_xpercent, new_ypercent);