| 494 } |
494 } |
| 495 |
495 |
| 496 static void set_grid_scale(MainState* state, const float factor) |
496 static void set_grid_scale(MainState* state, const float factor) |
| 497 { |
497 { |
| 498 const glm::mat4 original = state->mainWindow.gridMatrix->value(); |
498 const glm::mat4 original = state->mainWindow.gridMatrix->value(); |
| 499 const glm::mat4 unscaled = extractScaling(original).unscaled; |
499 const glm::mat4 unscaled = unscale_matrix(original).unscaled; |
| 500 const glm::mat4 rescaled = factor * unscaled; |
500 const glm::mat4 rescaled = factor * unscaled; |
| 501 state->mainWindow.gridMatrix->setValue(rescaled); |
501 state->mainWindow.gridMatrix->setValue(rescaled); |
| 502 update_model_grid_matrix(state); |
502 update_model_grid_matrix(state); |
| 503 } |
503 } |
| 504 |
504 |