yairm210 / Unciv

Open-source Android/Desktop remake of Civ V
Mozilla Public License 2.0
8.53k stars 1.58k forks source link

CityButton vertical assymmetry #9342

Closed SomeTroglodyte closed 7 months ago

SomeTroglodyte commented 1 year ago

I've long wondered why I could see a garrison (on the world map) easily in my capital but less so in all other cities... That's partially due to StatusTable (the connected/wltk/raze/puppet/etc icons). But even accounting for these and their different padding, the vertical alignment is off-center:

image image

Note both are cropped to exact tile boundaries (as far as my tottering fingers allowed in gimp).

One can also observe how our actors draw outside their bounds, which hinders layout tweaking to some extent.

Preliminary review led me to CityButton.kt line 452 - but why that was chosen as centerX instead of center (thus no explicit control of y that I can see) eludes me. Also, the setOrigin() line above does nothing at all as long as isTransform is false. Lastly, actually calling centerY will equalize things noticeably, but the center of weight as seen from scene2d debug lines still is visibly below the tile center.

Testing whether the tilegroups are not painting where my prejudices expect them to: image Nope, they do draw outside their declared bounds, and the center is off, but far less than the city buttons are..

Ouaz commented 1 year ago

Testing whether the tilegroups are not painting where my prejudices expect them to: image Nope, they do draw outside their declared bounds, and the center is off, but far less than the city buttons are.

Oooooh, does this explain why there's a slight offset using Thin Bubbly Borders?

offset

I tried for days to fix the borders being not "centered", thinking my svg file was wrong. :sweat_smile:

SomeTroglodyte commented 1 year ago

You know how to turn on "scene2d debug"? Secret options, turns on "mouse over" debug rectangles for a few widgets - that image was made that way. The displacement can best be seen by comparing the little triangles that are the "symmetrical set difference" between the hex and the square, those on top are smaller. So yes, would roughly match your pic's displacement.

And phew, Flamingo didn't improve stability, still need to killall java from a separate terminal when it freezes the whole desktop..

github-actions[bot] commented 8 months ago

This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 15 days.

github-actions[bot] commented 7 months ago

This issue was closed because it has been stalled for 5 days with no activity.