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

Calculate text bounds for all baselines #53

Closed
ystrot opened this issue Sep 10, 2016 · 1 comment
Closed

Calculate text bounds for all baselines #53

ystrot opened this issue Sep 10, 2016 · 1 comment
Assignees
Milestone

Comments

@ystrot
Copy link
Member

ystrot commented Sep 10, 2016

Currently it works correctly only for top and bottom baselines.

@ystrot ystrot added this to the Public release milestone Sep 10, 2016
@ystrot ystrot self-assigned this Sep 10, 2016
@ystrot ystrot modified the milestones: 0.8.0, Public release Oct 19, 2016
@ystrot
Copy link
Member Author

ystrot commented Oct 26, 2016

To resolve this issue we need to update Text.bounds() method. Currently it contains following code:

let size = ...
if (self.baseline == Baseline.bottom) {
    return Rect(x: 0, y: -Double(size.height), w: Double(size.width), h: Double(size.height))
}
return Rect(x: 0, y: 0, w: Double(size.width), h: Double(size.height))

So this method works correctly only when baseline equals to bottom or top. Need to implement corresponding login for alphabetic and mid values. It might be useful to take a look at the TextRenderer.calculateBaselineOffset() method.

@shipinev shipinev assigned shipinev and unassigned ystrot Dec 12, 2016
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

No branches or pull requests

2 participants