Hi!An easy thing to do, is to make the elements labeled. Which is different than creating a composite shape (I can detail why there are two ways to label elements).-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=| view shapes myElems |
view := RTView new.
myElems := 1 to: 2.
shapes := (RTSVGPath new
path: 'm 3.96875,9.2604167 h 31.75 V 25.135417 C 22.489583,23.8125
17.197917,34.395833 3.96875,27.78125 Z';
fillColor: Color red;
borderColor: Color black;
borderWidth: 1.2;
scale: 1.4) elementsOn: myElems.
view addAll: shapes.
shapes @ (RTLabeled new text: 'hello').
RTEdgeBuilder new
view: view;
shape: (RTArrowedLine new
color: Color black;
yourself);
elements: shapes;
connectFrom: 1 to: 2.
RTTreeLayout new
verticalGap: 30;
horizontalGap: 30;
applyOn: shapes.
view inspect.
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=Here is the resultCheers,Alexandre______________________________On Aug 23, 2018, at 2:31 PM, Hernán Morales Durand <hernan.morales@gmail.com> wrote:
Hi,
When connecting two composite shapes with RTEdgeBuilder, the connector
position loose its center over the connecting shapes.
It's easier to explain with two scripts:
This one looks good, the connector (RTArrowedLine) is centered:
| view shapes myElems |
view := RTView new.
myElems := 1 to: 2.
shapes := (RTSVGPath new
path: 'm 3.96875,9.2604167 h 31.75 V 25.135417 C 22.489583,23.8125
17.197917,34.395833 3.96875,27.78125 Z';
fillColor: Color red;
borderColor: Color black;
borderWidth: 1.2;
scale: 1.4) elementsOn: myElems.
view addAll: shapes.
RTEdgeBuilder new
view: view;
shape: (RTArrowedLine new
color: Color white;
yourself);
elements: shapes;
connectFrom: 1 to: 2.
RTTreeLayout new
verticalGap: 30;
horizontalGap: 30;
applyOn: shapes.
view inspect.
However when adding a label in a composite, both label and arrow looks shifted:
| view shape shapes myElems |
view := RTView new.
myElems := 1 to: 2.
shape := RTCompositeShape new
add: (RTLabel new text: 'Test');
add: (RTSVGPath new
path: 'm 3.96875,9.2604167 h 31.75 V 25.135417 C
22.489583,23.8125 17.197917,34.395833 3.96875,27.78125 Z';
fillColor: Color red;
borderColor: Color black;
borderWidth: 1.2;
scale: 1.4);
vertical;
yourself.
shapes := shape elementsOn: myElems.
view addAll: shapes.
RTEdgeBuilder new
view: view;
shape: (RTArrowedLine new
color: Color white;
yourself);
elements: shapes;
connectFrom: 1 to: 2.
RTTreeLayout new
verticalGap: 30;
horizontalGap: 30;
applyOn: shapes.
view inspect.
Any idea how to align these shapes?
Cheers,
Hernán_________________
Moose-dev mailing list
Moose-dev@list.inf.unibe.ch
https://www.list.inf.unibe.ch/listinfo/moose-dev
_______________________________________________
Moose-dev mailing list
Moose-dev@list.inf.unibe.ch
https://www.list.inf.unibe.ch/listinfo/moose-dev