GtkRadiant icon indicating copy to clipboard operation
GtkRadiant copied to clipboard

Surface Inspector: Match Grid button does not function properly

Open 0bsidian opened this issue 12 years ago • 1 comments

Note: This is a split of a previously reported bug #240

In the surface inspector, the Match Grid button does not work as expected. Hitting the Match Grid button should simply just change the H/V-shift "step" to match the current grid size. For example, if current grid size is 16, hitting Match Grid should change H/V-shift "step" to 16. Then if using the H/V-shift "value" spinner buttons, it should de/increment the current value by 16.

Currently, the Match Grid button does several things wrong:

  • Hitting the Match Grid button does not change the H/V-shift "step" to match the current grid size.
  • After hitting the Match Grid button it completely overrides H/V-shift "step" so that it no longer has any effect.
  • The Match Grid button provides incorrect values. Instead of just changing the H/V-shift "step" values, it's doing some weird dodgy math. It seems to be doing, grid-size / scale = step-size.

Match Grid is overcomplicating itself. I think we can fix all 3 of the above issues by simplifying whatever the hell it is trying to do. Match Grid should simply copy the grid-size and apply it to both the H-shift and V-shift "step".

0bsidian avatar Nov 28 '13 16:11 0bsidian

Check https://github.com/TTimo/GtkRadiant/blob/master/plugins/surface/surfacedialog.cpp#L397 You would have to pass 1.0 and 1.0 to DoSnapTToGrid here: https://github.com/TTimo/GtkRadiant/blob/master/plugins/surface/surfacedialog.cpp#L1308

Pan7 avatar Jan 24 '18 00:01 Pan7