-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Proposal for different lineJustify. #4437
Conversation
src/mixins/itext.svg_export.js
Outdated
@@ -119,7 +119,7 @@ | |||
textLeftOffset += charBox.kernedWidth - charBox.width; | |||
} | |||
boxWidth += charBox.kernedWidth; | |||
if (this.textAlign === 'justify' && !timeToRender) { | |||
if (this.textAlign.indexOf('justify') !== -1 && !timeToRender) { |
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.
this was not replaced in the whole code in the other PR,
src/shapes/text.class.js
Outdated
@@ -348,6 +348,9 @@ | |||
enlargeSpaces: function() { | |||
var diffSpace, currentLineWidth, numberOfSpaces, accumulatedSpace, line, charBound, spaces; | |||
for (var i = 0, len = this._textLines.length; i < len; i++) { | |||
if (i === len - 1 || this.isEndOfWrapping(i)) { |
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.
ok here needs a this.textAlign !== 'justify' && ( ..... )
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 still think this change is needed.
Since we are giving the user
justify-left, jsutify-right, justify-center, this thing here should change that we do not want the old plain justify
.
Who built an app over 2.0b7 or earlier, does not want to see old JSON saved with plain justify loaded differently just because we think is better to have last line not justified.
In this way we give an option to everyone at expense of littled added complexity, and we do not break old stuff.
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.
Sorry for the late response. Yes, i agree, backwards compatibility is important. Will you change it or should i?
@jilster since you started the whole thing, i would be happy if yo accelerate the thing you could test this branch and open a PR over it in order fix what is not really working. |
Thanks, i will do that! |
See #4441 |
i don't know if you were notified when i replied on a code review comment, but just to be sure: i am happy to do some last fixes if needed. |
i spent the weekend on fabricjs basically. |
very nice! 👍 |
Thank you guys! great job! |
* not even tested * Small fixes (fabricjs#4441) * fixed selection * fixed svg export
@jilster @blobinabottle
replaces #4369
This is my idea to implement it, giving us 3 different options.
To be honest i fast draft it, i did not event tested it.