Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Road depot window changes size frequently #6415

Closed
DorpsGek opened this issue Jan 25, 2016 · 1 comment
Closed

Road depot window changes size frequently #6415

DorpsGek opened this issue Jan 25, 2016 · 1 comment
Labels
component: interface This is an interface issue flyspray This issue is imported from FlySpray (https://bugs.openttd.org/)

Comments

@DorpsGek
Copy link
Member

Airbus opened the ticket and wrote:

In road vehicle depot, if a vehicle with 3 or 4 digit unit number enters the depot, depot window changes cell size, amount of columns and size of the whole window. Because of that, it's possible to miss sixth vehicle in a row, because a 3-digit vehicle just entered. And it's just not beautiful to have a jumping window.

This happens because in depot_gui.cpp default unit length is 2, OnPaint() looks for new unit number length, and if finds one that is not equal to current - changes current and reinits whole drawing.

How about changing this (depot_gui.cpp line 664-665):

if (this->unitnumber_digits != new_unitnumber_digits) {
this->unitnumber_digits = new_unitnumber_digits;

to this:

if (this->unitnumber_digits < new_unitnumber_digits) {
this->unitnumber_digits = new_unitnumber_digits;

This way it will reinit depot window less frequently (max 3 times for every window?), plus there will be no jumping from size to size.

Attachments

Reported version: 1.5.3
Operating system: Linux


This issue was imported from FlySpray: https://bugs.openttd.org/task/6415
@DorpsGek
Copy link
Member Author

frosch closed the ticket.

Reason for closing: Fixed

in r27583


This comment was imported from FlySpray: https://bugs.openttd.org/task/6415

@DorpsGek DorpsGek added component: interface This is an interface issue flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) bug labels Apr 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: interface This is an interface issue flyspray This issue is imported from FlySpray (https://bugs.openttd.org/)
Projects
None yet
Development

No branches or pull requests

1 participant