mirror of https://github.com/OpenTTD/OpenTTD
Compare commits
2 Commits
fca62c245f
...
289d6ebc43
Author | SHA1 | Date |
---|---|---|
|
289d6ebc43 | |
|
b4ff06b6ef |
|
@ -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:
|
||||
|
||||
- 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
|
||||
- [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)
|
||||
|
||||
Please follow the readme of these packages about the installation procedure.
|
||||
The Windows installer can optionally download and install these packages.
|
||||
|
|
|
@ -247,14 +247,21 @@ void Textbuf::DeleteText(uint16_t from, uint16_t to, bool update)
|
|||
this->bytes -= to - from;
|
||||
this->chars -= c;
|
||||
|
||||
/* Fixup caret if needed. */
|
||||
if (this->caretpos > from) {
|
||||
if (this->caretpos <= to) {
|
||||
this->caretpos = from;
|
||||
auto fixup = [&](uint16_t &pos) {
|
||||
if (pos <= from) return;
|
||||
if (pos <= to) {
|
||||
pos = from;
|
||||
} else {
|
||||
this->caretpos -= to - from;
|
||||
pos -= to - from;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/* Fixup caret if needed. */
|
||||
fixup(this->caretpos);
|
||||
|
||||
/* Fixup marked text if needed. */
|
||||
fixup(this->markpos);
|
||||
fixup(this->markend);
|
||||
|
||||
if (update) {
|
||||
this->UpdateStringIter();
|
||||
|
|
Loading…
Reference in New Issue