mirror of https://github.com/OpenTTD/OpenTTD
Compare commits
No commits in common. "289d6ebc436c5f03cb0785c529657e89e3144e11" and "fca62c245fa1fb546c15849d64c7be7b095539e7" have entirely different histories.
289d6ebc43
...
fca62c245f
|
@ -78,9 +78,9 @@ For some platforms, you will need to refer to [the installation guide](https://w
|
|||
The free data files, split into OpenGFX for graphics, OpenSFX for sounds and
|
||||
OpenMSX for music can be found at:
|
||||
|
||||
- [OpenGFX](https://www.openttd.org/downloads/opengfx-releases/latest)
|
||||
- [OpenSFX](https://www.openttd.org/downloads/opensfx-releases/latest)
|
||||
- [OpenMSX](https://www.openttd.org/downloads/openmsx-releases/latest)
|
||||
- https://www.openttd.org/downloads/opengfx-releases/latest for OpenGFX
|
||||
- https://www.openttd.org/downloads/opensfx-releases/latest for OpenSFX
|
||||
- https://www.openttd.org/downloads/openmsx-releases/latest for OpenMSX
|
||||
|
||||
Please follow the readme of these packages about the installation procedure.
|
||||
The Windows installer can optionally download and install these packages.
|
||||
|
|
|
@ -247,21 +247,14 @@ void Textbuf::DeleteText(uint16_t from, uint16_t to, bool update)
|
|||
this->bytes -= to - from;
|
||||
this->chars -= c;
|
||||
|
||||
auto fixup = [&](uint16_t &pos) {
|
||||
if (pos <= from) return;
|
||||
if (pos <= to) {
|
||||
pos = from;
|
||||
} else {
|
||||
pos -= to - from;
|
||||
}
|
||||
};
|
||||
|
||||
/* Fixup caret if needed. */
|
||||
fixup(this->caretpos);
|
||||
|
||||
/* Fixup marked text if needed. */
|
||||
fixup(this->markpos);
|
||||
fixup(this->markend);
|
||||
if (this->caretpos > from) {
|
||||
if (this->caretpos <= to) {
|
||||
this->caretpos = from;
|
||||
} else {
|
||||
this->caretpos -= to - from;
|
||||
}
|
||||
}
|
||||
|
||||
if (update) {
|
||||
this->UpdateStringIter();
|
||||
|
|
Loading…
Reference in New Issue