-
Notifications
You must be signed in to change notification settings - Fork 325
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
Say/think bubble SVG templates #177
Conversation
20400bc
to
858bea7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left a comment on #176; the comments here are only on the second commit.
src/util/svg-text-bubble.js
Outdated
return `<text fill="#575E75">${this.lines.join('\n')}</text>`; | ||
} | ||
|
||
toString (type, text, pointsLeft) { |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
if (!this._textSizeCache[svgString]) { | ||
this._textSizeCache[svgString] = this.svgRenderer.measure(svgString); | ||
} | ||
return this._textSizeCache[svgString]; |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
Proposed Changes
Describe what this Pull Request does
This PR builds on #176 (the first commit here) and two parts:
This is meant as conversation-starter code, it is still very early. The things I want to talk about w/ @cwillisf are:
svg-renderer
in order to measure the width/height of the text block before creating the enveloping path. Thesvg-renderer
isn't meant for this, because it also draws it to a canvas which we do not need. Is there a better way to share the measurement code, possibly drawing out and expanding theSVGMeasurementProvider
used in the text wrapping code?