~hikiko/compiz/compiz.shared-transform-ezoom

« back to all changes in this revision

Viewing changes to plugins/grid/src/grid.cpp

  • Committer: CI Train Bot
  • Author(s): Chris Townsend
  • Date: 2015-04-10 21:55:26 UTC
  • mfrom: (3938.6.1 fix-semi-max-gap)
  • Revision ID: ci-train-bot@canonical.com-20150410215526-x7igct1b0xfxm98n
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. Fixes: #1294864
Approved by: Stephen M. Webb, PS Jenkins bot

Show diffs side-by-side

added added

removed removed

Lines of Context:
206
206
        /* slice and dice to get desired slot - including decorations */
207
207
        desiredSlot.setY (workarea.y () + props.gravityDown *
208
208
                          (workarea.height () / props.numCellsY));
209
 
        desiredSlot.setHeight (workarea.height () / props.numCellsY);
 
209
        desiredSlot.setHeight (workarea.height () / (float)props.numCellsY + 0.5);
210
210
 
211
211
        desiredSlot.setX (workarea.x () + props.gravityRight *
212
212
                          (workarea.width () / props.numCellsX));
213
 
        desiredSlot.setWidth (workarea.width () / props.numCellsX);
 
213
        desiredSlot.setWidth (workarea.width () / (float)props.numCellsX + 0.5);
214
214
 
215
215
        if (!optionGetCycleSizes ())
216
216
        {