monitor-config-manager: Round layout size after scaling

When calculating the logical monitor layout size given a scale, don't
risk precision loss by float to int casting, which could result in a too
small layout.

https://bugzilla.gnome.org/show_bug.cgi?id=765011
This commit is contained in:
Jonas Ådahl 2017-10-27 17:41:42 +08:00
parent 666bef7af9
commit 4786cc85bd

View File

@ -545,8 +545,8 @@ create_preferred_logical_monitor_config (MetaMonitorManager *monitor_ma
switch (layout_mode)
{
case META_LOGICAL_MONITOR_LAYOUT_MODE_LOGICAL:
width /= scale;
height /= scale;
width = (int) roundf (width / scale);
height = (int) roundf (height / scale);
break;
case META_LOGICAL_MONITOR_LAYOUT_MODE_PHYSICAL:
break;