Git Product home page Git Product logo

Comments (3)

isacvandunem avatar isacvandunem commented on May 18, 2024

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:
image

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.

wafehling avatar wafehling commented on May 18, 2024

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.

PeterN avatar PeterN commented on May 18, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.