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
11541154 (_mouseVoxel.z + _mouseVoxel.s / 2.f) * TREE_SCALE);
11551155 }
11561156
1157−const float NUDGE_PRECISION_LIMIT = 1 / pow(2.0, 12.0);
1157+const float NUDGE_PRECISION_MIN = 1 / pow(2.0, 12.0);
11581158
11591159 void Application::decreaseVoxelSize() {
11601160 if (_nudgeStarted) {
1161− if (_mouseVoxelScale >= NUDGE_PRECISION_LIMIT) {
1161+ if (_mouseVoxelScale >= NUDGE_PRECISION_MIN) {
11621162 _mouseVoxelScale /= 2;
11631163 }
11641164 } else {
@@ -1167,7 +1167,13 @@ void Application::decreaseVoxelSize() { · 2 unmodified lines
11671167 }
11681168
11691169 void Application::increaseVoxelSize() {
1170− _mouseVoxelScale *= 2;
1170+ if (_nudgeStarted) {
1171+ if (_mouseVoxelScale < _nudgeVoxel.s) {
1172+ _mouseVoxelScale *= 2;
1173+ }
1174+ } else {
1175+ _mouseVoxelScale *= 2;
1176+ }
11711177 }
11721178
11731179 const 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