Merge lp:~townsend/compiz/fix-semi-max-gap into lp:compiz/0.9.12

Proposed by Christopher Townsend
Status: Merged
Approved by: Stephen M. Webb
Approved revision: 3939
Merged at revision: 3946
Proposed branch: lp:~townsend/compiz/fix-semi-max-gap
Merge into: lp:compiz/0.9.12
Diff against target: 17 lines (+2/-2)
1 file modified
plugins/grid/src/grid.cpp (+2/-2)
To merge this branch: bzr merge lp:~townsend/compiz/fix-semi-max-gap
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Stephen M. Webb Approve
Review via email: mp+255258@code.launchpad.net

Commit message

Grid plugin: Float to int division truncating caused a 1 px gap on the right side of right semi-maximized window when the workspace has an odd width. Fix is to add 0.5 to the float division first to account for any truncation error.

To post a comment you must log in.
Revision history for this message
Stephen M. Webb (bregma) :
review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugins/grid/src/grid.cpp'
2--- plugins/grid/src/grid.cpp 2014-04-07 20:03:29 +0000
3+++ plugins/grid/src/grid.cpp 2015-04-06 13:22:14 +0000
4@@ -206,11 +206,11 @@
5 /* slice and dice to get desired slot - including decorations */
6 desiredSlot.setY (workarea.y () + props.gravityDown *
7 (workarea.height () / props.numCellsY));
8- desiredSlot.setHeight (workarea.height () / props.numCellsY);
9+ desiredSlot.setHeight (workarea.height () / (float)props.numCellsY + 0.5);
10
11 desiredSlot.setX (workarea.x () + props.gravityRight *
12 (workarea.width () / props.numCellsX));
13- desiredSlot.setWidth (workarea.width () / props.numCellsX);
14+ desiredSlot.setWidth (workarea.width () / (float)props.numCellsX + 0.5);
15
16 if (!optionGetCycleSizes ())
17 {

Subscribers

People subscribed via source and target branches