Skip to content

Expand from Centre Issue (Fixes issue #7954)

Issue #7954 (closed) describes a problem that seems to go back at least 16 years to V2.3.12 but although several users have complained of the problem no one seems to have published a way of causing the problem to occur.

Although only reported for the Rectangle Select tool it also applies to the Ellipse Select tool and the Crop tool.

Also although only reported for the Fixed Centre option (connected with the ctrl key) it also applies to the Fixed Rule Active option (connected with the shift key).

Having had a lengthy play with it I stumbled across a (slightly convoluted) way of causing the problem to occur:

  1. Use the Rectangle Select tool
  2. Make sure that there is no current selection
  3. Set the tool to operate in Replace or Addition mode
  4. Press and hold the left mouse button (LMB)
  5. Drag the mouse to 'rubber-band' a new selection
  6. Press and hold the ctrl key
  7. Press and hold the right mouse button (RMB)
  8. Whilst still pressing the ctrl key and RMB release LMB
  9. The result is that the Expand from center option remains in its toggled state instead of returning to the state it was in before the selection started.

Given the above method of reproducing the fault looking at the code showed a second, simpler, method to reproduce the fault:

  1. Use the Rectangle Select tool
  2. Make sure that there is no current selection
  3. Set the tool to operate in Replace or Addition mode
  4. Make sure that the mouse does not move at all from this point on
  5. Press and hold the LMB
  6. Press and hold the ctrl key
  7. Whilst still holding the ctrl key release the LMB
  8. The result is that the Expand from center option remains in its toggled state instead of returning to the state it was in before the selection started.

It is, perhaps, easy to see how this second method could result in the Expand from centre option being turned on by users with less than precise finger-work using the selection tool together with ctrl-C and ctrl-V.

The attached change prevents both of the above methods of causing the fault for all three tools mentioned and for both the Expand from centre and Fixed options.

Merge request reports