History

Put upper bound on increasing nudge precision (i.e. making the nudge less precise).

LionTurtle committed 13 years ago

Commit 67bbcc41 parent 86d16661 file · +9 −3Browse files

Showing the changes to interface/src/Application.cpp (1 of 1 file). Show all

Unified · Split

interface/src/Application.cpp+9−3
@@ -1154,11 +1154,11 @@ const glm::vec3 Application::getMouseVoxelWorldCoordinates(const VoxelDetail _mo · 1153 unmodified lines
1154 (_mouseVoxel.z + _mouseVoxel.s / 2.f) * TREE_SCALE);1154 (_mouseVoxel.z + _mouseVoxel.s / 2.f) * TREE_SCALE);
1155}1155}
1156 1156
1157const float NUDGE_PRECISION_LIMIT = 1 / pow(2.0, 12.0);1157const float NUDGE_PRECISION_MIN = 1 / pow(2.0, 12.0);
1158 1158
1159void Application::decreaseVoxelSize() {1159void Application::decreaseVoxelSize() {
1160 if (_nudgeStarted) {1160 if (_nudgeStarted) {
1161 if (_mouseVoxelScale >= NUDGE_PRECISION_LIMIT) {1161 if (_mouseVoxelScale >= NUDGE_PRECISION_MIN) {
1162 _mouseVoxelScale /= 2;1162 _mouseVoxelScale /= 2;
1163 }1163 }
1164 } else {1164 } else {
@@ -1167,7 +1167,13 @@ void Application::decreaseVoxelSize() { · 2 unmodified lines
1167}1167}
1168 1168
1169void Application::increaseVoxelSize() {1169void Application::increaseVoxelSize() {
1170 _mouseVoxelScale *= 2;1170 if (_nudgeStarted) {
1171 if (_mouseVoxelScale < _nudgeVoxel.s) {
1172 _mouseVoxelScale *= 2;
1173 }
1174 } else {
1175 _mouseVoxelScale *= 2;
1176 }
1171}1177}
1172 1178
1173const int MAXIMUM_EDIT_VOXEL_MESSAGE_SIZE = 1500;1179const int MAXIMUM_EDIT_VOXEL_MESSAGE_SIZE = 1500;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t