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

Support for scaling during drawn boxed text #45

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Pidroh
Copy link

@Pidroh Pidroh commented Mar 18, 2020

When mixing drawBox with scale, text does not wrap up correctly

This happens because FC_GetBufferFitToColumn takes scale as a parameter but does not actually scale anything. I solved this problem by adding

width = (int)(width / scale.x);

To the beginning of FC_GetBufferFitToColumn.
There is also a similar problem of scale not being taken into account on the line distance. I fixed it by changing
y += FC_GetLineHeight(font);
to
y += FC_GetLineHeight(font)*scale.y;

When mixing drawBox with scale, text does not wrap up correctly

This happens because FC_GetBufferFitToColumn takes scale as a parameter but does not actually scale anything. I solved this problem by adding 

width = (int)(width / scale.x);

To the beginning of FC_GetBufferFitToColumn.
There is also a similar problem of scale not being taken into account on the line distance. I fixed it by changing 
y += FC_GetLineHeight(font);
to
y += FC_GetLineHeight(font)*scale.y;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant