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

Fix horizontal positioning of dropdown arrow glyph. #17593

Merged
merged 1 commit into from Jan 25, 2020

Conversation

@pchote
Copy link
Member

pchote commented Jan 19, 2020

This PR fixes the positioning issue reported in #17504 (comment) and #17506 (comment). It seems that this has always been broken, for all mods, but nobody noticed before now.

@reaperrr reaperrr merged commit cc53064 into OpenRA:bleed Jan 25, 2020
2 checks passed
2 checks passed
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@@ -47,7 +47,7 @@ public override void Draw()
var image = ChromeProvider.GetImage("scrollbar", IsDisabled() ? "down_pressed" : "down_arrow");
var rb = RenderBounds;

WidgetUtils.DrawRGBA(image, stateOffset + new float2(rb.Right - rb.Height + 4, rb.Top + (rb.Height - image.Bounds.Height) / 2));
WidgetUtils.DrawRGBA(image, stateOffset + new float2(rb.Right - rb.Height + 5, rb.Top + (rb.Height - image.Bounds.Height) / 2));

This comment has been minimized.

Copy link
@dragunoff

dragunoff Jan 25, 2020

Contributor

How about making the position dependent on the size of the image and the height of the dropdown versus a hard-coded offset:

WidgetUtils.DrawRGBA(image, stateOffset + new float2((rb.Right - (rb.Height + image.Bounds.Width) / 2), rb.Top + (rb.Height - image.Bounds.Height) / 2));

This would support more varied artwork.

This comment has been minimized.

Copy link
@dragunoff

dragunoff Jan 25, 2020

Contributor

Sorry, github's UI mislead me - I thought I had submitted this review...

This comment has been minimized.

Copy link
@pchote

pchote Jan 25, 2020

Author Member

Good idea. Do you want to file a new PR to cover this?

This comment has been minimized.

Copy link
@dragunoff

dragunoff Jan 25, 2020

Contributor

Sure, will do.

@pchote pchote deleted the pchote:fix-dropdown-glyph-offset branch Feb 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants
You can’t perform that action at this time.