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

Text alignment and origin issues. #2262

Closed
paulcanning opened this issue Jun 5, 2015 · 3 comments
Closed

Text alignment and origin issues. #2262

paulcanning opened this issue Jun 5, 2015 · 3 comments

Comments

@paulcanning
Copy link

So, 1.5.0 fixed a lot of issues I had with origins and translating it to CSS3.

Whilst this is ace, a new issue has come to light and I'm hoping it can either be looked into or there is a work around?

Basically, I need the text alignment to act independently of the origin.

So, if I have some text, one a few lines, and it is set to align left, with origin "center center", and I add more text, making the "bounding box" wider, it expands out form the center. I'd like it to expand to the right, so the left edge stays still.

I understand this is working as intended, as it is set to the center origin. But I would like it to be the way I described. Or at least given the option, or a way around this.

It causes issues with my application as it means if text is changed at a later date, it could look incorrect in respect to the text alignment, its position and surrounding elements.

See this basic fiddle, http://jsfiddle.net/hwtoc65g/, double click the text (its i-text) and start typing.

You'll see, despite the text alignment being set to "left", the box expands outwards form the center.

Is there a way to achieve what I want? :)

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@asturur
Copy link
Member

asturur commented Jun 5, 2015

hi @paulcanning,

i think this can be easily solved at application level.
Try to bind to the text:changed event (i think we have one) a workaround with the functions adjustposition and costraintposition, like we use for scaling.
If you notice, whatever is originX or originY the position stay same from the corner opposite the one you are pulling when you scale.
(try on kitchensink).

So i think that mixing those 2 functions you can make the iText staty in the current position.

I'm working on those function as of now for various reason, it may be i can make a demo.

Other story:
Could you please do a basic fiddle of the shadow on text problem you reported on other issue?
Otherwise i will close the issue for bug not showing up. ( i hope you understand ).

@paulcanning
Copy link
Author

If you could make a demo showing the workaround working, that would be great!

It is quite important, but I have some leeway on getting it sorted.

@asturur
Copy link
Member

asturur commented May 6, 2016

http://jsfiddle.net/hwtoc65g/7/

I know it is late, the fiddle shows what i meant.
I think that adding another feature about positioning is not the case.
You can still reposition the object programmatically very easy. I do not fill like adding another feature in this area.

@paulcanning, did you find another way around this when it was, 1 year ago?

@asturur asturur closed this as completed Jul 18, 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

3 participants