Showing the changes to interface/src/Application.cpp (1 of 3 files). Show all
Unified · Split
| @@ -1160,8 +1160,16 @@ const glm::vec3 Application::getMouseVoxelWorldCoordinates(const VoxelDetail _mo · 1159 unmodified lines | ||
| 1160 | 1160 | (_mouseVoxel.z + _mouseVoxel.s / 2.f) * TREE_SCALE); |
| 1161 | 1161 | } |
| 1162 | 1162 | |
| 1163 | +const float NUDGE_PRECISION_LIMIT = 1 / pow(2.0, 12.0); | |
| 1164 | + | |
| 1163 | 1165 | void Application::decreaseVoxelSize() { |
| 1164 | − _mouseVoxelScale /= 2; | |
| 1166 | + if (Menu::getInstance()->isOptionChecked(MenuOption::VoxelNudgeMode)) { | |
| 1167 | + if (_mouseVoxelScale >= NUDGE_PRECISION_LIMIT) { | |
| 1168 | + _mouseVoxelScale /= 2; | |
| 1169 | + } | |
| 1170 | + } else { | |
| 1171 | + _mouseVoxelScale /= 2; | |
| 1172 | + } | |
| 1165 | 1173 | } |
| 1166 | 1174 | |
| 1167 | 1175 | void Application::increaseVoxelSize() { |
| @@ -2315,17 +2323,18 @@ void Application::displaySide(Camera& whichCamera) { · 1147 unmodified lines | ||
| 2315 | 2323 | } else { |
| 2316 | 2324 | glColor3ub(_mouseVoxel.red, _mouseVoxel.green, _mouseVoxel.blue); |
| 2317 | 2325 | } |
| 2318 | − glTranslatef(_mouseVoxel.x + _mouseVoxel.s*0.5f, | |
| 2319 | − _mouseVoxel.y + _mouseVoxel.s*0.5f, | |
| 2320 | − _mouseVoxel.z + _mouseVoxel.s*0.5f); | |
| 2321 | − glLineWidth(4.0f); | |
| 2326 | + | |
| 2322 | 2327 | if (Menu::getInstance()->isOptionChecked(MenuOption::VoxelNudgeMode)) { |
| 2323 | − if (_nudgeVoxel.s) { | |
| 2324 | − glutWireCube(_nudgeVoxel.s); | |
| 2325 | − } else { | |
| 2326 | − glutWireCube(_mouseVoxel.s); | |
| 2327 | − } | |
| 2328 | + glTranslatef(_mouseVoxel.x + _nudgeVoxel.s*0.5f, | |
| 2329 | + _mouseVoxel.y + _nudgeVoxel.s*0.5f, | |
| 2330 | + _mouseVoxel.z + _nudgeVoxel.s*0.5f); | |
| 2331 | + glLineWidth(4.0f); | |
| 2332 | + glutWireCube(_nudgeVoxel.s); | |
| 2328 | 2333 | } else { |
| 2334 | + glTranslatef(_mouseVoxel.x + _mouseVoxel.s*0.5f, | |
| 2335 | + _mouseVoxel.y + _mouseVoxel.s*0.5f, | |
| 2336 | + _mouseVoxel.z + _mouseVoxel.s*0.5f); | |
| 2337 | + glLineWidth(4.0f); | |
| 2329 | 2338 | glutWireCube(_mouseVoxel.s); |
| 2330 | 2339 | } |
| 2331 | 2340 | glLineWidth(1.0f); |