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

Link the text inside a shape to the shape #1010

Open
pshihn opened this issue Mar 18, 2020 · 12 comments
Open

Link the text inside a shape to the shape #1010

pshihn opened this issue Mar 18, 2020 · 12 comments

Comments

@pshihn
Copy link
Collaborator

@pshihn pshihn commented Mar 18, 2020

It can get a bit annoying when trying to move a block but it doesn't move the text inside it. Not a big issue, but I have forgotten to rubber-band (or command click) to move them together way too many times now :(

(I think there's a separate issue about linking arrows to shapes which is related)

@dwelle
Copy link
Member

@dwelle dwelle commented Mar 19, 2020

Related to (and possibly blocked by) #294. Let's keep this open, but as for how to implement this, let's move there because it'll require more meta discussion.

@ReneCode
Copy link
Contributor

@ReneCode ReneCode commented Jul 9, 2020

What's about the idea to move also all elements that are completely inside the moving element.
So any element will be moved when its surrounding element is moved.

That behaviour will not be limited to text inside box, but working for all element types.

moveTextWithBox

@xixixao
Copy link
Collaborator

@xixixao xixixao commented Jul 10, 2020

I think this issue is nicely and more generically addressed by groups. @ReneCode give it a try (select multiple elements, cmd+option+g on mac).

@ReneCode
Copy link
Contributor

@ReneCode ReneCode commented Jul 10, 2020

@xixixao yes, you are right -looks better using group. Because on resize the text-element will be resized too.

May be thinking about an "automatic-grouping" approach would help to make the workflow smoother, like:

  • draw rectangle
  • draw text (starting point is inside the rectangle => both are grouped)
  • move rectangle
    => rectangle and text are moved.

@xixixao
Copy link
Collaborator

@xixixao xixixao commented Jul 10, 2020

Grouping text to the shape when the text is created (via double click or text tool) while the shape is selected might work. It should still not autogroup if the shape is not selected and I'm adding text inside of it.

(then again any of this could be too much magic and stirring away from "just whiteboard" approach)

@ReneCode
Copy link
Contributor

@ReneCode ReneCode commented Jul 12, 2020

I've tried out to make auto-grouping when the new text is inside an element.
try here

It works fine - if you leave the size of the element. But on resizing the element the text is resized too. That results a bad looking result when in a diagram with several elements with text the text size is different.

may be this approach is not ideal.

@xixixao
Copy link
Collaborator

@xixixao xixixao commented Jul 15, 2020

@ReneCode you need to double click the group and then only resize the rectangle (so I don't think this is a big problem).

I wonder how @vjeux likes this version.

@dwelle
Copy link
Member

@dwelle dwelle commented Jul 15, 2020

Using grouping to solve this case came across my mind as well, but @ReneCode has a valid point. As an interim solution maybe?

@vjeux
Copy link
Contributor

@vjeux vjeux commented Jul 15, 2020

I feel like it achieves the behavior we want: when you move the shape it moves the text around. Now there are some unfortunate side effects:

  • Scaling the shape: now it's just in one axis and not the other. It also scales the text which is unexpected.
  • Changing the text is harder. You need to quadruple click. Inner selection is a bit more weird.

I feel like the downsides are greater than the wins. I feel like once the arrow linking is implemented, we can use the same link in order to move things around and it wouldn't have those drawbacks.

@xixixao
Copy link
Collaborator

@xixixao xixixao commented Jul 16, 2020

@vjeux Do you imagine we'll allow binding text to rectangles? I think this runs into a problem if we also want to allow binding of arrows to text, see bottom of my initial PR comment: #1899 .

@vjeux
Copy link
Contributor

@vjeux vjeux commented Jul 16, 2020

Interesting. I didn't think you'd be able to bind arrows to text fwiw.

@ttjmartinez
Copy link

@ttjmartinez ttjmartinez commented Dec 5, 2021

I like the way it is done in yED, when you drag some object into some other object , if you have pressed at the time release the button, becomes a component within , and from that time on they move together whenever moves. You can still move inside , but if you try to drag outside of , then needs to grow in order to keep containing it. In order to detach from , grab it, then press move it out of and release the button.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
6 participants