Comments (3)
This seems to only happen on large numbers as the UI was designed in small numbers in mind ?
For a small amount of ships it looks good:
What would be the desired approach to fix this ?
Apply more spacing to it ?
Lower the font so that it fits still on higher numbers ?
Does applying more space to it directly run the risk of messing the rest of the UI on spacing as well ?
from openttd.
I believe I've narrowed down a good place to start to line 1706 in vehicle_gui.cpp:
int text_offset = std::max<int>(profit.width, GetDigitWidth() * this->unitnumber_digits) + WidgetDimensions::scaled.hsep_normal;
It looks like GetDigitWidth takes the width of the standard font size, not the unit number font. So it gets closer as it gets longer and starts getting close to/overlapping the group name by 4 digits (It supports up to 5). Probably just need to be changed to GetDigitWidth() * 1.5 * this->unitnumber_digits
or GetDigitWidth() * 2 * this->unitnumber_digits
to have it offset without overlap.
Not available to test this at the moment, but that's about as simple as it gets is someone wants to give it a try.
from openttd.
The "unit number font" is the standard font, the issue is it's just counting digits, and ignoring the comma.
from openttd.
Related Issues (20)
- [Crash]: Selling a vehicle after returning to depot
- [Bug]: Click/tooltip vertical misalignment for cargo line (CFT_CARGO) in industry chain window
- [Crash]: changing setting when running OpenTTD from DropBox HOT 3
- [Bug]: Using disconnect button in main menu opens multiplayer lobby HOT 2
- [Bug]: The description for "minutes per year" could improved HOT 3
- [Bug]: GSText broken by 14.0 (Invalid parameter) HOT 2
- [Bug]: Vehicle::motion_counter for articulated train engine parts no longer updated due to #12229
- [Bug]: Desync errors since 14.0 HOT 11
- [Bug]: Station/industry nearby industry lists can become incorrect after BuildOilRig is called
- [Bug]: Timer period modifications may violate invariants of TimerManager::base_timer_sorter std::set sorting
- [Bug]: ``screenshot minimap`` is stored incorrect place in dedicated server HOT 3
- [Crash]: Assertion failed at line 114 of D:\\a\\OpenTTD\\OpenTTD\\src\\core\\pool_type.hpp: index < this->first_unused HOT 4
- [Bug]: Passengers are not accepted by all industrial factories HOT 7
- [Bug] Avatar skin color should be a dropdown menu instead of racial selectors HOT 8
- [Crash]: "id": 3221225477, "reason": "EXCEPTION_ACCESS_VIOLATION" - OpenTTD_crash20240423150954 HOT 1
- [Bug]: Unbunch breaks CargoDist HOT 3
- [Bug]: Possible race condition in WinHTTP backend
- [Bug]: Updates on admin port are unreliable HOT 1
- [Bug]: GSText maximum params HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from openttd.