diff options
author | rubidium <rubidium@openttd.org> | 2009-01-08 16:35:45 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2009-01-08 16:35:45 +0000 |
commit | 7a5798695decde2af2ba719aee96f2bcaa7d9e95 (patch) | |
tree | 9a9133dd8ea3555a253b9e604560b979c9ed0481 /src/viewport.cpp | |
parent | d29dc478ddfc06715ca0d7b346e70c9a198629d5 (diff) | |
download | openttd-7a5798695decde2af2ba719aee96f2bcaa7d9e95.tar.xz |
(svn r14919) -Feature: distant joining of stations (Frostregen and PhilSophus)
Diffstat (limited to 'src/viewport.cpp')
-rw-r--r-- | src/viewport.cpp | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/src/viewport.cpp b/src/viewport.cpp index 88278309b..4572665e4 100644 --- a/src/viewport.cpp +++ b/src/viewport.cpp @@ -2175,11 +2175,17 @@ void UpdateTileSelection() /* clear the old selection? */ if (_thd.drawstyle) SetSelectionTilesDirty(); - _thd.drawstyle = _thd.new_drawstyle; - _thd.pos = _thd.new_pos; - _thd.size = _thd.new_size; + if (!_thd.lock_pos) { + _thd.pos = _thd.new_pos; + _thd.drawstyle = _thd.new_drawstyle; + } + + if (!_thd.lock_size) { + _thd.size = _thd.new_size; + _thd.dirty = 0xff; + } + _thd.outersize = _thd.new_outersize; - _thd.dirty = 0xff; /* draw the new selection? */ if (_thd.new_drawstyle) SetSelectionTilesDirty(); @@ -2619,7 +2625,7 @@ calc_heightdiff_single_direction:; y = sy + Clamp(y - sy, -limit, limit); } /* Fallthrough */ case VPM_X_AND_Y: { /* drag an X by Y area */ - if (_settings_client.gui.measure_tooltip) { + if (_settings_client.gui.measure_tooltip && !_thd.lock_size) { static const StringID measure_strings_area[] = { STR_NULL, STR_NULL, STR_MEASURE_AREA, STR_MEASURE_AREA_HEIGHTDIFF }; @@ -2713,6 +2719,10 @@ void SetObjectToPlaceWnd(CursorID icon, SpriteID pal, ViewportHighlightMode mode void SetObjectToPlace(CursorID icon, SpriteID pal, ViewportHighlightMode mode, WindowClass window_class, WindowNumber window_num) { + /* unlock position and size */ + _thd.lock_pos = false; + _thd.lock_size = false; + /* undo clicking on button and drag & drop */ if (_thd.place_mode != VHM_NONE || _special_mouse_mode == WSM_DRAGDROP) { Window *w = FindWindowById(_thd.window_class, _thd.window_number); |