← Back to team overview

widelands-dev team mailing list archive

[Merge] lp:~widelands-dev/widelands/fix_wrong_integer into lp:widelands

 

SirVer has proposed merging lp:~widelands-dev/widelands/fix_wrong_integer into lp:widelands.

Commit message:
Fix a crash in ui.lua

In some cases, we asked this function to scroll to a fraction of a pixel which
it does not support. Round down to avoid this case.

Found with my UI fuzzer. 


Requested reviews:
  Widelands Developers (widelands-dev)

For more details, see:
https://code.launchpad.net/~widelands-dev/widelands/fix_wrong_integer/+merge/334284
-- 
Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/fix_wrong_integer into lp:widelands.
=== modified file 'data/scripting/ui.lua'
--- data/scripting/ui.lua	2017-01-24 21:30:52 +0000
+++ data/scripting/ui.lua	2017-11-26 13:36:29 +0000
@@ -67,7 +67,7 @@
 --
 function mouse_to_pixel(x, y)
    _await_animation()
-   wl.ui.MapView():mouse_to_pixel(x, y)
+   wl.ui.MapView():mouse_to_pixel(math.floor(x), math.floor(y))
    _await_animation()
 end
 


Follow ups