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 offset of chatbox cursor #282

Merged
merged 1 commit into from Mar 31, 2019

Conversation

@Forgon2100
Copy link
Contributor

commented Mar 28, 2019

The chatbox cursor no longer appears the width of an hyphen ahead of text.

The attached zip file contains:

  • screenshots and videos showing the cursor position in the game setup screen
  • a shell script to generate them

chatbox_cursor_offset_documentation.zip

Fix horizontal offset of chatbox cursor
Refs ticket:4796
Fixes #282

@past-due past-due self-requested a review Mar 28, 2019

@past-due past-due added this to the 3.3.0_beta2 milestone Mar 28, 2019

@past-due past-due self-assigned this Mar 30, 2019

@past-due

This comment has been minimized.

Copy link
Contributor

commented Mar 30, 2019

This is a solid change, but it revealed the need for other changes in the text handling code. Am working on those now.

@Forgon2100

This comment has been minimized.

Copy link
Contributor Author

commented Mar 30, 2019

This is a solid change, but it revealed the need for other changes in the text handling code. Am working on those now.

Will this change the GUI (which I'm working on currently)?

@past-due

This comment has been minimized.

Copy link
Contributor

commented Mar 30, 2019

This is a solid change, but it revealed the need for other changes in the text handling code. Am working on those now.

Will this change the GUI (which I'm working on currently)?

If you're working on anything that affects alignment or positioning of GUI elements that involve text, possibly.

EDIT: Just to bring a bit of clarity - one of the major issues is that the current text-handling code makes no distinction between the width of the internal rasterized text buffer / image that needs to be drawn, and the layout width of the text. (It just uses the former.) This is why when you ask for the width of a string that ends in a space, it doesn't properly include the full layout width of the space. (But this is just an obvious manifestation of the problem.)

@WZ2100ModsFan

This comment has been minimized.

Copy link

commented Mar 31, 2019

I'm willing to look at the zip file and then test this from appveyor.

@past-due
Copy link
Contributor

left a comment

Upcoming changes will further improve the edit box cursor accuracy, but this is a necessary prerequisite. Looks good. 👍

See: #287

@past-due past-due merged commit 8944aac into Warzone2100:master Mar 31, 2019

8 checks passed

LGTM analysis: C/C++ No new or fixed alerts
Details
LGTM analysis: JavaScript No code changes detected
Details
LGTM analysis: Python No code changes detected
Details
WIP Ready for review
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
freebsd_build FreeBSD:freebsd-11-2-release-amd64 Task Summary
Details
freebsd_build FreeBSD:freebsd-12-0-release-amd64 Task Summary
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.